From: Eric Paris Date: Sun, 13 Jan 2008 21:20:56 +0000 (-0500) Subject: rfkill: call rfkill_led_trigger_unregister() on error X-Git-Tag: v2.6.24~26^2~16 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=632041f306707df94110441f55b1458ebeb096db;p=linux-2.6 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 Signed-off-by: John W. Linville --- diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 4469a7be00..d06d338812 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; }