* [PATCH] rfkill - rfkill_register() doesn't call rfkill_led_trigger_unregister() on error
@ 2008-01-13 21:20 Eric Paris
0 siblings, 0 replies; only message in thread
From: Eric Paris @ 2008-01-13 21:20 UTC (permalink / raw)
To: bcm43xx-dev; +Cc: mb, linville, linux-wireless
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>
---
net/rfkill/rfkill.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 4469a7b..d06d338 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;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-13 21:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-13 21:20 [PATCH] rfkill - rfkill_register() doesn't call rfkill_led_trigger_unregister() on error Eric Paris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox