Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

most: usb: Use kzalloc_objs for endpoint address array

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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260225180329.712101-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thorsten Blum and committed by
Greg Kroah-Hartman
bdb61896 71f0a267

+2 -4
+2 -4
drivers/most/most_usb.c
··· 1009 1009 goto err_free_conf; 1010 1010 1011 1011 mdev->iface.channel_vector = mdev->cap; 1012 - mdev->ep_address = 1013 - kcalloc(num_endpoints, sizeof(*mdev->ep_address), GFP_KERNEL); 1012 + mdev->ep_address = kzalloc_objs(*mdev->ep_address, num_endpoints); 1014 1013 if (!mdev->ep_address) 1015 1014 goto err_free_cap; 1016 1015 1017 - mdev->busy_urbs = 1018 - kzalloc_objs(*mdev->busy_urbs, num_endpoints); 1016 + mdev->busy_urbs = kzalloc_objs(*mdev->busy_urbs, num_endpoints); 1019 1017 if (!mdev->busy_urbs) 1020 1018 goto err_free_ep_address; 1021 1019