Skip to content

Commit 29ff665

Browse files
mungewellJiri Kosina
authored andcommitted
HID: logitech: Prevent possibility of infinite loop when using /sys interface
If the device data is not accessible for some reason, returning 0 will cause the call to be continuously called again as none of the string has been 'consumed'. Signed-off-by: Simon Wood <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent daebdd7 commit 29ff665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-lg4ff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,13 @@ static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *at
451451
drv_data = hid_get_drvdata(hid);
452452
if (!drv_data) {
453453
hid_err(hid, "Private driver data not found!\n");
454-
return 0;
454+
return -EINVAL;
455455
}
456456

457457
entry = drv_data->device_props;
458458
if (!entry) {
459459
hid_err(hid, "Device properties not found!\n");
460-
return 0;
460+
return -EINVAL;
461461
}
462462

463463
if (range == 0)

0 commit comments

Comments
 (0)