Skip to contentSkip to conversation

HID: sensor: custom: Fix the sensor state allocation

PATCH In review Sasha Levin 2 participants 2 messages Nov 20

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: sensor: custom: Fix the sensor state allocation

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

---

 drivers/hid/hid-sensor-custom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hid/hid-sensor-custom.c +1 -2
index 66fca5c4855b5..8a71e86d247b1 100644
@@ -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

Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 10 lines · Sasha Levin

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

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.

Signature · 2 lines
Jiri Kosina
SUSE Labs