From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A7963FF883; Thu, 19 Mar 2026 21:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773954699; cv=none; b=WXDckmfFbwxuPxn9HDAOsxprSbUkrTvd73lQM4WiOy8g/ROvwhCpS3lc8zVMdnRSeKZxvD48WvzeoIekCQeD/HzlTUSvOd0YaXBMzHpybHa1B8dp8PGfzFxnOla02yMiMmmiMC+NZDRP/9Ll3lQOVdDywZxgCmLvV4x1dy5KHbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773954699; c=relaxed/simple; bh=cktKzwYMrKV2arN68rUyoWolcM+aLEW/5dsoh0URqkI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZzZqJK03cBvG/MJ9Ixk2MYdJIDpm44RCUwKK9wMr/g1xJ9TsPG7x9kS8u7M02yzfTrC4W2KrKqVXBEzqyQLZyEF27bNCpfiIFgeXw1I7XuSPDuW2ZDdBRkJg0TFTXLBEMBgqUzG/zZ9kIP6+xD627e2ILU9gZmGNzRLuwW9Db7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hibZZQqT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hibZZQqT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E15FBC19424; Thu, 19 Mar 2026 21:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773954698; bh=cktKzwYMrKV2arN68rUyoWolcM+aLEW/5dsoh0URqkI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hibZZQqTlWdAl4xW8if8rWWAWA3zw5gtQagmgARtWjE55wwyp3v0gmOQ8ySV+8V1a 5sDhIlV/+yNMurrzy7vAwbBbVyPHyYa4tX6g/2ASRnes66IAntLEH9sufL+jqkD6pW Kpgc3+4NNER719MvGC8/ZCRlbAPLaHANhw3lEKcbxkYJUF0wtaQsOdYsGS0E0RzzwK a6yNEbgIkMBpot+3Y352IGV8ZYWZoZjycFbaLfR8iJUpim3ov8y3YVtT/drwOChwaI u3beBff4pFQFlUTZZDOVmnHrZFnkGZHk3PfqwZ2wvtZtb4y0j5/s/CcMixAeOXNQDh y2t2pft3LT75A== Date: Thu, 19 Mar 2026 14:11:38 -0700 From: Kees Cook To: Loke Forsberg Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, khtsai@google.com, raubcameo@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: gadget: f_ncm: replace kzalloc with kzalloc_obj Message-ID: <202603191410.9DF140D@keescook> References: <20260315111827.20205-1-Loke.Forsberg@gmail.com> <202603191337.2EFF6F7A@keescook> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202603191337.2EFF6F7A@keescook> 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