summaryrefslogtreecommitdiffstats
path: root/net/rfkill/rfkill.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-21 19:42:25 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-21 19:42:25 -0800
commitf290fc3669d659a915e29b6bdb82d454b437cf93 (patch)
tree1c6d7122e4462f15f6db05255c7cd89badcb576f /net/rfkill/rfkill.c
parent240d3b54e3a8a8d469f0ff6deacf52f4b751f55a (diff)
parent5b4d383a1a562de6955cacd72e20809064ee137f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: [ICMP]: ICMP_MIB_OUTMSGS increment duplicated [IPV6]: RFC 2011 compatibility broken [IPV6]: ICMP6_MIB_OUTMSGS increment duplicated [NET]: rtnl_link: fix use-after-free [AF_KEY]: Fix skb leak on pfkey_send_migrate() error [ATM] atm/suni.c: Fix section mismatch. [ATM] atm/idt77105.c: Fix section mismatch. [IrDA]: af_irda memory leak fixes [NEIGH]: Revert 'Fix race between neigh_parms_release and neightbl_fill_parms' [NETFILTER]: bridge-netfilter: fix net_device refcnt leaks [IPV6] ROUTE: Make sending algorithm more friendly with RFC 4861. [IPV4] FIB_HASH : Avoid unecessary loop in fn_hash_dump_zone() [NET]: Fix interrupt semaphore corruption in Intel drivers. [IPV4] fib_trie: fix duplicated route issue [IPV4] fib_hash: fix duplicated route issue [IPV6]: Mischecked tw match in __inet6_check_established. rfkill: call rfkill_led_trigger_unregister() on error
Diffstat (limited to 'net/rfkill/rfkill.c')
-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 4469a7be006..d06d338812e 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;
}