summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-07-02 00:08:54 +0300
committerJacek Anaszewski <j.anaszewski@samsung.com>2016-07-04 09:51:37 +0300
commita3eac76cdf7225aa1f87aa4514664f0372b9a1c1 (patch)
treef42b457060a20c98a31961d8de632db66336928f /drivers
parentb1ae40a5db6191c42e2e45d726407096f030ee08 (diff)
downloadlinux-a3eac76cdf7225aa1f87aa4514664f0372b9a1c1.tar.xz
leds: triggers: return error if invalid trigger name is provided via sysfs
If an invalid trigger name is provided via sysfs currently no error is returned. Therefore it's not possible to determine whether the trigger was set successfully. Fix this by returning -EINVAL if no trigger is matched. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/led-triggers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 55fa65e1ae03..c92702a684ce 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -60,6 +60,8 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
goto unlock;
}
}
+ /* we come here only if buf matches no trigger */
+ ret = -EINVAL;
up_read(&triggers_list_lock);
unlock: