summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2008-01-13 16:20:56 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-20 20:31:36 -0800
commit632041f306707df94110441f55b1458ebeb096db (patch)
treeeffe40dae5c459f6ee20ce55d2f2f7810aceb132
parenta7da60f41551abb3c520b03d42ec05dd7decfc7f (diff)
downloadlinux-632041f306707df94110441f55b1458ebeb096db.tar.gz
linux-632041f306707df94110441f55b1458ebeb096db.tar.bz2
linux-632041f306707df94110441f55b1458ebeb096db.zip
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>
-rw-r--r--net/rfkill/rfkill.c5
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)
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;
}