struct hid_sensor_custom_properties is currently 384 bytes big, which consumes
too much stack space for no good reason. Make it dynamically allocated.
Fixes: 98c062e824519 ("HID: hid-sensor-custom: Allow more custom iio sensors")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
int ret;
const struct hid_sensor_custom_match *match =
hid_sensor_custom_known_table;
int ret;
const struct hid_sensor_custom_match *match =
hid_sensor_custom_known_table;
- struct hid_sensor_custom_properties prop;
+ struct hid_sensor_custom_properties *prop;
- ret = hid_sensor_custom_properties_get(hsdev, &prop);
+ prop = kmalloc(sizeof(struct hid_sensor_custom_properties), GFP_KERNEL);
+ if (!prop)
+ return -ENOMEM;
+
+ ret = hid_sensor_custom_properties_get(hsdev, prop);
- if (hid_sensor_custom_do_match(hsdev, match, &prop)) {
+ if (hid_sensor_custom_do_match(hsdev, match, prop)) {
+ ret = -ENODATA;
+out:
+ kfree(prop);
+ return ret;
}
static struct platform_device *
}
static struct platform_device *