diff options
Diffstat (limited to 'drivers/staging/vt6655/hostap.c')
-rw-r--r-- | drivers/staging/vt6655/hostap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index 8417c2f2c6cf..57a08c5771f2 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -80,7 +80,7 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name); - pDevice->apdev = kzalloc(sizeof(struct net_device), GFP_KERNEL); + pDevice->apdev = alloc_etherdev(sizeof(*apdev_priv)); if (pDevice->apdev == NULL) return -ENOMEM; @@ -104,6 +104,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) if (ret) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: register_netdevice(AP) failed!\n", dev->name); + free_netdev(pDevice->apdev); + pDevice->apdev = NULL; return -1; } @@ -141,7 +143,7 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", pDevice->dev->name, pDevice->apdev->name); } - kfree(pDevice->apdev); + free_netdev(pDevice->apdev); pDevice->apdev = NULL; pDevice->bEnable8021x = false; pDevice->bEnableHostWEP = false; |