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

Commit b0e66fb7 authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman
Browse files

staging: gasket: apex return error on sysfs show of missing attribute



Apex sysfs show function return -ENODEV if the attribute is not present,
rather than silently failing from the standpoint of the userspace
accessor.

Reported-by: default avatarGuenter Roeck <groeck@chromium.org>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e2f00f0b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -710,14 +710,14 @@ static ssize_t sysfs_show(
	gasket_dev = gasket_sysfs_get_device_data(device);
	if (!gasket_dev) {
		gasket_nodev_error("No Apex device sysfs mapping found");
		return 0;
		return -ENODEV;
	}

	gasket_attr = gasket_sysfs_get_attr(device, attr);
	if (!gasket_attr) {
		gasket_nodev_error("No Apex device sysfs attr data found");
		gasket_sysfs_put_device_data(device, gasket_dev);
		return 0;
		return -ENODEV;
	}

	type = (enum sysfs_attribute_type)gasket_sysfs_get_attr(device, attr);