Commit 632041f3 authored by Eric Paris's avatar Eric Paris Committed by David S. Miller

rfkill: call rfkill_led_trigger_unregister() on error

Code inspection turned up that error cases in rfkill_register() do not
call rfkill_led_trigger_unregister() even though we have already
registered.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a7da60f4
......@@ -392,11 +392,14 @@ int rfkill_register(struct rfkill *rfkill)
rfkill_led_trigger_register(rfkill);
error = rfkill_add_switch(rfkill);
if (error)
if (error) {
rfkill_led_trigger_unregister(rfkill);
return error;
}
error = device_add(dev);
if (error) {
rfkill_led_trigger_unregister(rfkill);
rfkill_remove_switch(rfkill);
return error;
}
......
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