Re: [PATCH] usb: gadget: f_ncm: replace kzalloc with kzalloc_obj
From: Kees Cook
Date: Thu Mar 19 2026 - 17:11:53 EST
On Thu, Mar 19, 2026 at 01:38:23PM -0700, Kees Cook wrote:
> I was surprised to find this wasn't caught by the original conversion
> script, but I suspect Coccinelle is choking on the use of the cleanup
> attributes:
>
> struct usb_os_desc_table *os_desc_table __free(kfree) = NULL;
> ...
> if (cdev->use_os_string) {
> os_desc_table = kzalloc(sizeof(*os_desc_table), GFP_KERNEL);
>
>
> I'll see if I can figure this out. I may need to send another set of
> bulk replacements...
Ah, it's not so bad. Latest Coccinelle handles the cleanup attributes
correctly:
72 files changed, 104 insertions(+), 117 deletions(-)
--
Kees Cook