Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: sensor: custom: Fix the sensor state allocation
@ 2026-11-20 13:27 Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-11-20 13:27 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: Srinivas Pandruvada, Jonathan Cameron, linux-input, linux-iio,
	linux-kernel

Commit d8dcea5754a2 ("HID: sensor: custom: Fix state lifetime during
removal") was applied with kzalloc(&pdev->dev, sizeof(*sensor_inst),
GFP_KERNEL), which does not build:

  drivers/hid/hid-sensor-custom.c:1023:46: error: macro 'kzalloc' passed 3 arguments, but takes just 2

The posted patch has kzalloc_obj(*sensor_inst). Use that.

Fixes: d8dcea5754a2 ("HID: sensor: custom: Fix state lifetime during removal")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

 drivers/hid/hid-sensor-custom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index 66fca5c4855b5..8a71e86d247b1 100644
--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -1019,8 +1019,7 @@ static int hid_sensor_custom_probe(struct platform_device *pdev)
 	int ret;
 	const struct hid_sensor_custom_match *match;
 
-	sensor_inst = kzalloc(&pdev->dev, sizeof(*sensor_inst),
-				   GFP_KERNEL);
+	sensor_inst = kzalloc_obj(*sensor_inst);
 	if (!sensor_inst)
 		return -ENOMEM;
 

base-commit: edf34adc3136d3e231f042b6622a51876bd80468
-- 
2.53.0


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

only message in thread, other threads:[~2026-11-20 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 13:27 [PATCH] HID: sensor: custom: Fix the sensor state allocation Sasha Levin

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