Messages in this thread | | | Date | Thu, 18 Jan 2024 08:18:22 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH] coccinelle: semantic patch to check for potential struct_size calls |
| |
On Wed, Jan 17, 2024 at 09:54:19PM +0000, Keller, Jacob E wrote: > > drivers/misc/vmw_vmci/vmci_datagram.c > > 227 dg_info = kmalloc(sizeof(*dg_info) + > > 228 (size_t) dg->payload_size, GFP_ATOMIC); > > > > The Cocci check is looking specifically for: > > > > sizeof(*dg_info) + (sizeof(*dg_info->msg_payload) * dg->payload_size) > > > > I think that's a slightly different formulation. >
I thought that that was what the check was looking for. To me it seems like an unusual way to write it, but it's not buggy and your Coccinelle script did trigger a warning correctly... But yeah, I was slightly puzzled why it would be in this format.
regards, dan carpenter
| |