linux/drivers/usb/gadget/udc/cdns2
Kees Cook 69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
..
cdns2-debug.h usb: cdns2: Replace snprintf() with the safer scnprintf() variant 2023-12-15 13:55:30 +01:00
cdns2-ep0.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
cdns2-gadget.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
cdns2-gadget.h usb: cdns2: Fix controller reset issue 2024-09-03 10:03:54 +02:00
cdns2-pci.c usb: cdns3: Synchronise PCI IDs via common data base 2024-11-13 07:16:31 +01:00
cdns2-trace.c usb: cdns2: Add tracepoints for CDNS2 driver 2023-06-13 11:59:29 +02:00
cdns2-trace.h cdns2: Remove unused tracepoints 2025-09-06 15:23:39 +02:00
Kconfig
Makefile usb: cdns2: Add tracepoints for CDNS2 driver 2023-06-13 11:59:29 +02:00