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>
This commit is contained in:
Simon Wood 2014-08-14 20:43:01 -06:00 committed by Jiri Kosina
parent daebdd7ee3
commit 29ff66571d
1 changed files with 2 additions and 2 deletions

View File

@ -451,13 +451,13 @@ static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *at
drv_data = hid_get_drvdata(hid);
if (!drv_data) {
hid_err(hid, "Private driver data not found!\n");
return 0;
return -EINVAL;
}
entry = drv_data->device_props;
if (!entry) {
hid_err(hid, "Device properties not found!\n");
return 0;
return -EINVAL;
}
if (range == 0)