diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2007-05-25 12:09:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:39 -0400 |
commit | 6a8121572e2f2d188f04673bfa460ccfcedeb008 (patch) | |
tree | e184d6d5fe764fcef9a2b43e9b8f283f71de9e23 | |
parent | 51d84f501684db22f5fcc30821cbbde2a0a2f264 (diff) |
[PATCH] libertas: fix error handling of card initialization
Subject says it all.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 7ce57d4bcc81..d4db8e668e78 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -198,10 +198,10 @@ static int if_usb_probe(struct usb_interface *intf, | |||
198 | goto dealloc; | 198 | goto dealloc; |
199 | 199 | ||
200 | if (wlan_add_mesh(priv)) | 200 | if (wlan_add_mesh(priv)) |
201 | goto dealloc; | 201 | goto err_add_mesh; |
202 | 202 | ||
203 | if (libertas_activate_card(priv)) | 203 | if (libertas_activate_card(priv)) |
204 | goto dealloc; | 204 | goto err_activate_card; |
205 | 205 | ||
206 | if (libertas_found < MAX_DEVS) { | 206 | if (libertas_found < MAX_DEVS) { |
207 | libertas_devs[libertas_found] = priv->wlan_dev.netdev; | 207 | libertas_devs[libertas_found] = priv->wlan_dev.netdev; |
@@ -218,6 +218,12 @@ static int if_usb_probe(struct usb_interface *intf, | |||
218 | */ | 218 | */ |
219 | return 0; | 219 | return 0; |
220 | 220 | ||
221 | err_activate_card: | ||
222 | unregister_netdev(priv->mesh_dev); | ||
223 | free_netdev(priv->mesh_dev); | ||
224 | err_add_mesh: | ||
225 | free_netdev(priv->wlan_dev.netdev); | ||
226 | kfree(priv->adapter); | ||
221 | dealloc: | 227 | dealloc: |
222 | if_usb_free(usb_cardp); | 228 | if_usb_free(usb_cardp); |
223 | 229 | ||
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 899090108837..5c58c50b430d 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -823,6 +823,7 @@ wlan_private *wlan_add_card(void *card) | |||
823 | 823 | ||
824 | err_kzalloc: | 824 | err_kzalloc: |
825 | free_netdev(dev); | 825 | free_netdev(dev); |
826 | priv = NULL; | ||
826 | done: | 827 | done: |
827 | lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv); | 828 | lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv); |
828 | return priv; | 829 | return priv; |