* [PATCH] atmel: unregister_netdev() on error
@ 2010-07-10 13:11 Kulikov Vasiliy
[not found] ` <1278767508-10164-1-git-send-email-segooon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Kulikov Vasiliy @ 2010-07-10 13:11 UTC (permalink / raw)
To: kernel-janitors
Cc: Simon Kelley, John W. Linville, David S. Miller,
Stephen Hemminger, Eric Dumazet, Ben Hutchings, linux-wireless,
netdev
We must unregister registered device if probe_atmel_card() fails.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/net/wireless/atmel.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index c8f7090..b9334a3 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -1626,7 +1626,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
if (!probe_atmel_card(dev)) {
unregister_netdev(dev);
- goto err_out_res;
+ goto err_out_unreg;
}
netif_carrier_off(dev);
@@ -1640,6 +1640,9 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
return dev;
+err_out_unreg:
+ unregister_netdev(dev);
+
err_out_res:
release_region(dev->base_addr, 32);
err_out_irq:
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] atmel: unregister_netdev() on error
[not found] ` <1278767508-10164-1-git-send-email-segooon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2010-07-10 14:12 ` Dan Carpenter
2010-07-10 16:38 ` Kulikov Vasiliy
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-07-10 14:12 UTC (permalink / raw)
To: Kulikov Vasiliy
Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Simon Kelley,
John W. Linville, David S. Miller, Stephen Hemminger,
Eric Dumazet, Ben Hutchings,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
On Sat, Jul 10, 2010 at 05:11:47PM +0400, Kulikov Vasiliy wrote:
> We must unregister registered device if probe_atmel_card() fails.
I think you hit send accidentally on this one?
> if (!probe_atmel_card(dev)) {
> unregister_netdev(dev);
^^^^^^^^^^^^^^^^^^^^^^^
> - goto err_out_res;
> + goto err_out_unreg;
> }
>
> netif_carrier_off(dev);
> @@ -1640,6 +1640,9 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
>
> return dev;
>
> +err_out_unreg:
> + unregister_netdev(dev);
^^^^^^^^^^^^^^^^^^^^^^
> +
What the pants? :P
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] atmel: unregister_netdev() on error
2010-07-10 14:12 ` Dan Carpenter
@ 2010-07-10 16:38 ` Kulikov Vasiliy
0 siblings, 0 replies; 3+ messages in thread
From: Kulikov Vasiliy @ 2010-07-10 16:38 UTC (permalink / raw)
To: Dan Carpenter
Cc: kernel-janitors, Simon Kelley, John W. Linville, David S. Miller,
Stephen Hemminger, Eric Dumazet, Ben Hutchings, linux-wireless,
netdev
On Sat, Jul 10, 2010 at 16:12 +0200, Dan Carpenter wrote:
> > +err_out_unreg:
> > + unregister_netdev(dev);
> ^^^^^^^^^^^^^^^^^^^^^^
> > +
>
> What the pants? :P
Hmm, I've slightly misunderstood the code, sorry.
Thanks, Dan.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-10 16:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10 13:11 [PATCH] atmel: unregister_netdev() on error Kulikov Vasiliy
[not found] ` <1278767508-10164-1-git-send-email-segooon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-07-10 14:12 ` Dan Carpenter
2010-07-10 16:38 ` Kulikov Vasiliy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).