Commit a3eac76c authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Jacek Anaszewski

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
parent b1ae40a5
...@@ -60,6 +60,8 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, ...@@ -60,6 +60,8 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
goto unlock; goto unlock;
} }
} }
/* we come here only if buf matches no trigger */
ret = -EINVAL;
up_read(&triggers_list_lock); up_read(&triggers_list_lock);
unlock: unlock:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment