Commit 29ff66571d38f01c5a5d3af871401b8a65323422
Committed by
Jiri Kosina
1 parent
daebdd7ee3
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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 <simon@mungewell.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/hid/hid-lg4ff.c
... | ... | @@ -451,13 +451,13 @@ |
451 | 451 | drv_data = hid_get_drvdata(hid); |
452 | 452 | if (!drv_data) { |
453 | 453 | hid_err(hid, "Private driver data not found!\n"); |
454 | - return 0; | |
454 | + return -EINVAL; | |
455 | 455 | } |
456 | 456 | |
457 | 457 | entry = drv_data->device_props; |
458 | 458 | if (!entry) { |
459 | 459 | hid_err(hid, "Device properties not found!\n"); |
460 | - return 0; | |
460 | + return -EINVAL; | |
461 | 461 | } |
462 | 462 | |
463 | 463 | if (range == 0) |