if (!wl)
return -ENOMEM;
- if (wilc_wlan_cfg_init(wl))
+ ret = wilc_wlan_cfg_init(wl);
+ if (ret)
goto free_wl;
*wilc = wl;
INIT_LIST_HEAD(&wl->rxq_head.list);
wl->hif_workqueue = create_singlethread_workqueue("WILC_wq");
- if (!wl->hif_workqueue)
+ if (!wl->hif_workqueue) {
+ ret = -ENOMEM;
goto free_cfg;
+ }
register_inetaddr_notifier(&g_dev_notifier);
struct wireless_dev *wdev;
ndev = alloc_etherdev(sizeof(struct wilc_vif));
- if (!ndev)
+ if (!ndev) {
+ ret = -ENOMEM;
goto free_ndev;
+ }
vif = netdev_priv(ndev);
memset(vif, 0, sizeof(struct wilc_vif));
wdev = wilc_create_wiphy(ndev, dev);
if (!wdev) {
netdev_err(ndev, "Can't register WILC Wiphy\n");
+ ret = -ENOMEM;
goto free_ndev;
}
wilc_wlan_cfg_deinit(wl);
free_wl:
kfree(wl);
- return -ENOMEM;
+ return ret;
}
EXPORT_SYMBOL_GPL(wilc_netdev_init);