Hi Heiner, On 07/01/2016 11:08 PM, Heiner Kallweit wrote:
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@xxxxxxxxx> --- drivers/leds/led-triggers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 55fa65e..c92702a 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:
Thanks for the patch. Applied. -- Best regards, Jacek Anaszewski -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html