Commit 3593a6d6 authored by Richard Purdie's avatar Richard Purdie

leds: Fix trigger unregister_simple if register_simple fails

Fix led_trigger_unregister_simple to handle the case where
led_trigger_register_simple fails, avoiding a NULL pointer
dereference.
Signed-off-by: default avatarRichard Purdie <rpurdie@rpsys.net>
parent 66242f7e
......@@ -215,6 +215,7 @@ void led_trigger_unregister(struct led_trigger *trigger)
void led_trigger_unregister_simple(struct led_trigger *trigger)
{
if (trigger)
led_trigger_unregister(trigger);
kfree(trigger);
}
......
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