diff options
author | Eric Paris <eparis@redhat.com> | 2008-01-13 16:20:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-20 23:31:36 -0500 |
commit | 632041f306707df94110441f55b1458ebeb096db (patch) | |
tree | effe40dae5c459f6ee20ce55d2f2f7810aceb132 /net/rfkill/rfkill.c | |
parent | a7da60f41551abb3c520b03d42ec05dd7decfc7f (diff) |
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>
Diffstat (limited to 'net/rfkill/rfkill.c')
-rw-r--r-- | net/rfkill/rfkill.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 4469a7be006c..d06d338812e9 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
@@ -392,11 +392,14 @@ int rfkill_register(struct rfkill *rfkill) | |||
392 | rfkill_led_trigger_register(rfkill); | 392 | rfkill_led_trigger_register(rfkill); |
393 | 393 | ||
394 | error = rfkill_add_switch(rfkill); | 394 | error = rfkill_add_switch(rfkill); |
395 | if (error) | 395 | if (error) { |
396 | rfkill_led_trigger_unregister(rfkill); | ||
396 | return error; | 397 | return error; |
398 | } | ||
397 | 399 | ||
398 | error = device_add(dev); | 400 | error = device_add(dev); |
399 | if (error) { | 401 | if (error) { |
402 | rfkill_led_trigger_unregister(rfkill); | ||
400 | rfkill_remove_switch(rfkill); | 403 | rfkill_remove_switch(rfkill); |
401 | return error; | 404 | return error; |
402 | } | 405 | } |