linux/drivers/extcon
Kees Cook ef16259088 extcon: realtek: Remove const from type_c_cfg allocation type
In preparation for making the devm_kmalloc family of allocators type
aware, we need to make sure that the returned type from the allocation
matches the type of the variable being assigned. (Before, the allocator
would always return "void *", which can be implicitly cast to any
pointer type.)

The assigned type is "struct type_c_cfg *", but the converted allocation
type would be "const struct type_c_cfg *", as the size was taken from
the local "type_c_cfg", which points to const as it comes from
of_device_get_match_data(). As there is no general way to remove const
qualifiers, take the size from the assignment target instead. No change
in allocation size results.

Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0:
drivers/extcon/extcon-rtk-type-c.o

Assisted-by: LLM coccinelle
Link: https://patch.msgid.link/20260917211246.i.196-kees@kernel.org
Signed-off-by: Kees Cook <kees+treewide@kernel.org>
2026-10-11 22:18:42 -07:00
..
devres.c
extcon-adc-jack.c iio: inkern: Use namespaced exports 2026-07-05 01:37:19 +01:00
extcon-axp288.c extcon: axp288: Fix wakeup source leaks on device unbind 2025-08-26 19:51:36 +09:00
extcon-fsa9480.c extcon: fsa9480: Fix wakeup source leaks on device unbind 2025-08-26 19:51:36 +09:00
extcon-gpio.c
extcon-intel-cht-wc.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
extcon-intel-int3496.c extcon: int3496: replace use of system_wq with system_percpu_wq 2026-03-20 11:20:43 +09:00
extcon-intel-mrfld.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
extcon-intel.h
extcon-lc824206xa.c extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE 2024-09-05 01:44:51 +09:00
extcon-max3355.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
extcon-max8997.c
extcon-max14526.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
extcon-max14577.c
extcon-max77693.c
extcon-max77843.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
extcon-palmas.c
extcon-ptn5150.c extcon: ptn5150: Support USB role switch via connector fwnode 2026-03-20 11:20:43 +09:00
extcon-qcom-spmi-misc.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
extcon-rt8973a.c
extcon-rt8973a.h
extcon-rtk-type-c.c extcon: realtek: Remove const from type_c_cfg allocation type 2026-10-11 22:18:42 -07:00
extcon-sm5502.c
extcon-sm5502.h
extcon-usb-gpio.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
extcon-usbc-cros-ec.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
extcon-usbc-tusb320.c extcon: usbc-tusb320: Make typec-power-opmode optional 2026-03-20 11:20:43 +09:00
extcon.c extcon: Fixed sysfs duplicate filename issue 2026-03-20 11:20:43 +09:00
extcon.h
Kconfig extcon: ptn5150: Add Type-C orientation switch support 2026-03-20 11:20:43 +09:00
Makefile extcon: Add basic support for Maxim MAX14526 MUIC 2025-09-08 14:43:00 +09:00