Search Linux Wireless

[PATCH] atmel: unregister_netdev() on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We must unregister registered device if probe_atmel_card() fails.

Signed-off-by: Kulikov Vasiliy <segooon@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux