HID: sensor: custom: Fix the sensor state allocation
Subsystems (3)
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.
---
drivers/hid/hid-sensor-custom.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hid/hid-sensor-custom.c +1 -2
@@ -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
Jiri Kosina
maintainerQuoted 10 lines · Sasha Levin
Commit
d8dcea5754a2("HID: sensor: custom: Fix state lifetime during removal") was applied withkzalloc(&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 2The posted patch has
kzalloc_obj(*sensor_inst). Use that.Fixes d8dcea5754a2 ("HID: sensor: custom: Fix state lifetime during removal")Signed-off-by Sasha Levin <[email protected]>
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