提交 6a812157 编写于 作者: M Marcelo Tosatti 提交者: John W. Linville

[PATCH] libertas: fix error handling of card initialization

Subject says it all.
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 51d84f50
......@@ -198,10 +198,10 @@ static int if_usb_probe(struct usb_interface *intf,
goto dealloc;
if (wlan_add_mesh(priv))
goto dealloc;
goto err_add_mesh;
if (libertas_activate_card(priv))
goto dealloc;
goto err_activate_card;
if (libertas_found < MAX_DEVS) {
libertas_devs[libertas_found] = priv->wlan_dev.netdev;
......@@ -218,6 +218,12 @@ static int if_usb_probe(struct usb_interface *intf,
*/
return 0;
err_activate_card:
unregister_netdev(priv->mesh_dev);
free_netdev(priv->mesh_dev);
err_add_mesh:
free_netdev(priv->wlan_dev.netdev);
kfree(priv->adapter);
dealloc:
if_usb_free(usb_cardp);
......
......@@ -823,6 +823,7 @@ wlan_private *wlan_add_card(void *card)
err_kzalloc:
free_netdev(dev);
priv = NULL;
done:
lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv);
return priv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册