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: Eric Paris <eparis@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
a7da60f415
commit
632041f306
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue