diff options
author | Todd Poynor <toddpoynor@google.com> | 2018-07-21 06:35:01 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-24 13:56:46 +0200 |
commit | b0e66fb7ba060243f71f6871c988846d74bac0ac (patch) | |
tree | 957e49ae13cc5f42c1bf84ab65bb85c8d99aac76 /drivers/staging/gasket/apex_driver.c | |
parent | e2f00f0b9876387e38849e7b1338ac684a7a6562 (diff) |
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: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gasket/apex_driver.c')
-rw-r--r-- | drivers/staging/gasket/apex_driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c index 3e76c4db5db2..1c6f73b5a2a9 100644 --- a/drivers/staging/gasket/apex_driver.c +++ b/drivers/staging/gasket/apex_driver.c @@ -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); |