[PATCH] HID: sensor: custom: Fix the sensor state allocation

From: Sasha Levin

Date: Fri Nov 20 2026 - 08:27:58 EST


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

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