linux/drivers/hid
Kees Cook 189f164e57 Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:

  // SPDX-License-Identifier: GPL-2.0-only
  // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
  virtual patch

  @gfp depends on patch && !(file in "tools") && !(file in "samples")@
  identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
 		    kzalloc_obj,kzalloc_objs,kzalloc_flex,
		    kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
		    kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
  @@

  	ALLOC(...
  -		, GFP_KERNEL
  	)

  $ make coccicheck MODE=patch COCCI=gfp.cocci

Build and boot tested x86_64 with Fedora 42's GCC and Clang:

Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-22 08:26:33 -08:00
..
amd-sfh-hid Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bpf Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
i2c-hid Input updates for v7.0-rc0 2026-02-15 08:24:19 -08:00
intel-ish-hid Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
intel-thc-hid Merge branch 'for-6.20/intel-thc' into for-linus 2026-02-09 17:36:30 +01:00
surface-hid HID: intel-thc: fix CONFIG_HID dependency 2025-02-03 10:56:43 +01:00
usbhid Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
.kunitconfig
Kconfig Merge branch 'for-6.20/elecom' into for-linus 2026-02-09 17:34:17 +01:00
Makefile HID: rapoo: Add support for side buttons on RAPOO 0x2015 mouse 2026-01-10 09:52:37 +01:00
hid-a4tech.c
hid-accutouch.c
hid-alps.c HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM 2026-01-28 19:23:15 +01:00
hid-apple.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-appleir.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hid-appletb-bl.c HID: hid-appletb-bl: fix incorrect error message for default brightness 2025-02-18 22:01:54 +01:00
hid-appletb-kbd.c HID: appletb-kbd: Use pm_ptr instead of #ifdef CONFIG_PM 2026-01-28 19:23:16 +01:00
hid-asus.c platform-drivers-x86 for v7.0-1 2026-02-13 15:39:15 -08:00
hid-aureal.c
hid-axff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-belkin.c
hid-betopff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-bigbenff.c
hid-cherry.c
hid-chicony.c
hid-cmedia.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-core.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
hid-corsair-void.c HID: corsair-void: Use %pe for printing PTR_ERR 2025-11-18 18:03:48 +01:00
hid-corsair.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-cougar.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-cp2112.c HID: cp2112: Add parameter validation to data length 2025-10-14 11:46:49 +02:00
hid-creative-sb0540.c
hid-cypress.c
hid-debug.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-dr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-elan.c
hid-elecom.c HID: elecom: Add support for ELECOM HUGE Plus M-HT1MRBK 2026-01-23 13:53:25 +01:00
hid-elo.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-emsff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-evision.c HID: evision: Fix Report Descriptor for Evision Wireless Receiver 320f:226f 2025-11-26 17:17:53 +01:00
hid-ezkey.c
hid-ft260.c
hid-gaff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-gembird.c
hid-generic.c drivers: hid: renegotiate resolution multipliers with device after reset 2025-11-26 17:21:48 +01:00
hid-gfrm.c
hid-glorious.c
hid-goodix-spi.c
hid-google-hammer.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
hid-google-stadiaff.c
hid-gt683r.c
hid-gyration.c
hid-haptic.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
hid-haptic.h HID: multitouch: add haptic multitouch support 2025-09-15 14:32:55 +02:00
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-hyperv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-icade.c
hid-ids.h Merge branch 'for-6.20/elecom' into for-linus 2026-02-09 17:34:17 +01:00
hid-input-test.c HID: input: rename hidinput_set_battery_charge_status() 2025-08-20 20:03:39 +02:00
hid-input.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-ite.c
hid-jabra.c
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-kysona.c HID: Kysona: Add periodic online check 2025-04-24 11:23:08 +02:00
hid-lcpower.c
hid-led.c
hid-lenovo.c HID: lenovo: Use pm_ptr instead of #ifdef CONFIG_PM 2026-01-28 19:23:16 +01:00
hid-letsketch.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hid-lg-g15.c HID: hid-lg-g15: Add hw_brightness_changed support for the G510 keyboard 2025-10-14 11:50:25 +02:00
hid-lg.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-lg.h
hid-lg2ff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-lg3ff.c
hid-lg4ff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-lg4ff.h
hid-lgff.c
hid-logitech-dj.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-logitech-hidpp.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-macally.c
hid-magicmouse.c HID: magicmouse: Do not crash on missing msc->input 2026-01-10 10:25:25 +01:00
hid-maltron.c
hid-mcp2200.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
hid-mcp2221.c hid-for-linus-2025082901 2025-08-29 07:44:14 -07:00
hid-megaworld.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-mf.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-microsoft.c
hid-monterey.c
hid-multitouch.c HID: multitouch: add eGalaxTouch EXC3188 support 2026-01-23 13:54:21 +01:00
hid-nintendo.c HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM 2026-01-28 19:23:16 +01:00
hid-nti.c
hid-ntrig.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-nvidia-shield.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hid-ortek.c
hid-penmount.c
hid-petalynx.c
hid-picolcd.h
hid-picolcd_backlight.c
hid-picolcd_cir.c
hid-picolcd_core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-picolcd_debugfs.c kernel.h: drop hex.h and update all hex.h users 2026-01-20 19:44:19 -08:00
hid-picolcd_fb.c - Improved handling of LCD power states and interactions with the fbdev subsystem. 2024-11-22 16:29:57 -08:00
hid-picolcd_lcd.c
hid-picolcd_leds.c
hid-pl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-plantronics.c HID: hid-plantronics: Add mic mute mapping and generalize quirks 2025-02-03 11:09:05 +01:00
hid-playstation.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-primax.c
hid-prodikeys.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-pxrc.c
hid-quirks.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-rapoo.c HID: rapoo: Add support for side buttons on RAPOO 0x2015 mouse 2026-01-10 09:52:37 +01:00
hid-razer.c
hid-redragon.c
hid-retrode.c
hid-rmi.c
hid-roccat-arvo.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h sysfs: treewide: switch back to bin_attribute::read()/write() 2025-06-17 10:44:13 +02:00
hid-roccat-isku.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-isku.h
hid-roccat-kone.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-kone.h
hid-roccat-koneplus.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-koneplus.h
hid-roccat-konepure.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-kovaplus.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-kovaplus.h
hid-roccat-lua.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-lua.h
hid-roccat-pyra.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-pyra.h
hid-roccat-ryos.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-savu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-roccat-savu.h
hid-roccat.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-saitek.c
hid-samsung.c
hid-semitek.c
hid-sensor-custom.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-sensor-hub.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
hid-sigmamicro.c
hid-sjoy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-sony.c Merge branch 'for-6.20/pm_ptr-v3' into for-linus 2026-02-09 17:37:58 +01:00
hid-speedlink.c
hid-steam.c HID: hid-steam: Use new BTN_GRIP* buttons 2025-08-06 10:02:28 -07:00
hid-steelseries.c HID: steelseries: Fix STEELSERIES_SRWS1 handling in steelseries_remove() 2025-09-12 16:27:35 +02:00
hid-sunplus.c
hid-thrustmaster.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-tivo.c
hid-tmff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-topre.c HID: topre: Fix n-key rollover on Realforce R3S TKL boards 2025-02-03 22:59:42 +01:00
hid-topseed.c
hid-twinhan.c
hid-u2fzero.c
hid-uclogic-core-test.c
hid-uclogic-core.c HID: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM 2026-01-28 19:23:17 +01:00
hid-uclogic-params-test.c
hid-uclogic-params.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-uclogic-params.h HID: uclogic: Add support for the XP-PEN Artist 24 Pro 2025-10-14 12:01:34 +02:00
hid-uclogic-rdesc-test.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
hid-uclogic-rdesc.c HID: uclogic: Add support for the XP-PEN Artist 24 Pro 2025-10-14 12:01:34 +02:00
hid-uclogic-rdesc.h HID: uclogic: Add support for the XP-PEN Artist 24 Pro 2025-10-14 12:01:34 +02:00
hid-udraw-ps3.c
hid-universal-pidff.c HID: universal-pidff: clang-format pass 2025-08-15 15:58:10 +02:00
hid-viewsonic.c
hid-vivaldi-common.c
hid-vivaldi-common.h
hid-vivaldi.c
hid-vrc2.c
hid-waltop.c
hid-wiimote-core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-wiimote-debug.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-wiimote-modules.c
hid-wiimote.h
hid-winwing.c HID: winwing: Improve Orion2 throttle support 2025-10-14 11:20:21 +02:00
hid-xiaomi.c
hid-xinmo.c
hid-zpff.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hid-zydacron.c
hidraw.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
uhid.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wacom.h HID: wacom: Improve behavior of non-standard LED brightness values 2025-01-09 09:58:28 +01:00
wacom_sys.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wacom_wac.c HID: wacom: Add a new Art Pen 2 2025-08-12 14:56:35 +02:00
wacom_wac.h HID: wacom: Remove static WACOM_PKGLEN_MAX limit 2025-03-04 21:51:04 +01:00