Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29ff6657 authored by Simon Wood's avatar Simon Wood Committed by Jiri Kosina
Browse files

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: default avatarSimon Wood <simon@mungewell.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent daebdd7e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)