diff options
| author | Simon Wood <simon@mungewell.org> | 2014-08-14 22:43:01 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2014-08-15 04:54:13 -0400 |
| commit | 29ff66571d38f01c5a5d3af871401b8a65323422 (patch) | |
| tree | f15a16911b64b63c5167d01193554a1fd356c429 | |
| parent | daebdd7ee30b4ec7dd6a4e90f1f66c86ec113bbc (diff) | |
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>
| -rw-r--r-- | drivers/hid/hid-lg4ff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index cc2bd2022198..7835717bc020 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
| @@ -451,13 +451,13 @@ static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *at | |||
| 451 | drv_data = hid_get_drvdata(hid); | 451 | drv_data = hid_get_drvdata(hid); |
| 452 | if (!drv_data) { | 452 | if (!drv_data) { |
| 453 | hid_err(hid, "Private driver data not found!\n"); | 453 | hid_err(hid, "Private driver data not found!\n"); |
| 454 | return 0; | 454 | return -EINVAL; |
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | entry = drv_data->device_props; | 457 | entry = drv_data->device_props; |
| 458 | if (!entry) { | 458 | if (!entry) { |
| 459 | hid_err(hid, "Device properties not found!\n"); | 459 | hid_err(hid, "Device properties not found!\n"); |
| 460 | return 0; | 460 | return -EINVAL; |
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | if (range == 0) | 463 | if (range == 0) |
