mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] HID: sensor: custom: Fix the sensor state allocation
@ 2026-11-20 13:27 Sasha Levin
  2026-11-20 14:08 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages 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	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: sensor: custom: Fix the sensor state allocation
  2026-11-20 13:27 [PATCH] HID: sensor: custom: Fix the sensor state allocation Sasha Levin
@ 2026-11-20 14:08 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2026-11-20 14:08 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Benjamin Tissoires, Srinivas Pandruvada, Jonathan Cameron,
	linux-input, linux-iio, linux-kernel

On Fri, 20 Nov 2026, Sasha Levin wrote:

> 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>

Thanks Sasha, I've just fixed this a couple minutes ago in hid.git 
already, so the compile failure should be gone.

This was me fat-fingering merge.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-20 14:08 UTC | newest]

Thread overview: 2+ messages (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
2026-11-20 14:08 ` Jiri Kosina

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

all inboxes | Powered by JetHome®