public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] most: usb: Use kzalloc_objs for endpoint address array
@ 2026-03-09 22:34 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-03-09 22:34 UTC (permalink / raw)
  To: Parthiban Veerasooran, Christian Gromm
  Cc: Thorsten Blum, Kees Cook, linux-kernel

Replace kcalloc() with kzalloc_objs() when allocating the endpoint
address array to keep the size type-safe and match nearby allocations.
Reformat ->busy_urbs allocation to a single line. No functional change.

Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/most/most_usb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c
index d2c0875727a3..6437733afee0 100644
--- a/drivers/most/most_usb.c
+++ b/drivers/most/most_usb.c
@@ -1009,13 +1009,11 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
 		goto err_free_conf;
 
 	mdev->iface.channel_vector = mdev->cap;
-	mdev->ep_address =
-		kcalloc(num_endpoints, sizeof(*mdev->ep_address), GFP_KERNEL);
+	mdev->ep_address = kzalloc_objs(*mdev->ep_address, num_endpoints);
 	if (!mdev->ep_address)
 		goto err_free_cap;
 
-	mdev->busy_urbs =
-		kzalloc_objs(*mdev->busy_urbs, num_endpoints);
+	mdev->busy_urbs = kzalloc_objs(*mdev->busy_urbs, num_endpoints);
 	if (!mdev->busy_urbs)
 		goto err_free_ep_address;
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-09 22:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 22:34 [PATCH RESEND] most: usb: Use kzalloc_objs for endpoint address array Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox