Commit fc6bda52 authored by Alexander Viro's avatar Alexander Viro Committed by Stephen Hemminger

[all over] more kfree -> free_netdev

Remaining kfree -> free_netdev replacements (easy part of free_netdev() fixes)
parent 021c59c4
......@@ -482,7 +482,7 @@ etrax_ethernet_init(void)
/* Register device */
err = register_netdev(dev);
if (err) {
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -224,7 +224,7 @@ simeth_probe1(void)
err = register_netdev(dev);
if (err) {
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -851,7 +851,7 @@ static int __init scc_enet_init(void)
err = register_netdev(dev);
if (err) {
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -1371,7 +1371,7 @@ static int __init fec_enet_init(void)
err = register_netdev(dev);
if (err) {
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -949,7 +949,7 @@ static int __init scc_enet_init(void)
err = register_netdev(dev);
if (err) {
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -1748,7 +1748,7 @@ static int __init fec_enet_init(void)
err = register_netdev(dev);
if (err) {
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -1437,7 +1437,7 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
SET_MODULE_OWNER(dev);
if (register_netdev(dev) != 0) {
kfree(dev);
free_netdev(dev);
dev = NULL;
}
return dev;
......
......@@ -262,7 +262,7 @@ struct net_device * __init cops_probe(int unit)
out1:
cleanup_card(dev);
out:
kfree(dev);
free_netdev(dev);
return ERR_PTR(err);
}
......
......@@ -4501,7 +4501,7 @@ static int __init iph5526_init(void)
iph5526_probe_pci(dev);
err = register_netdev(dev);
if (err < 0) {
kfree(dev);
free_netdev(dev);
printk("iph5526.c: init_fcdev failed for card #%d\n", i+1);
break;
}
......
......@@ -1129,7 +1129,7 @@ static irqreturn_t xl_interrupt(int irq, void *dev_id, struct pt_regs *regs)
xl_freemem(dev) ;
free_irq(dev->irq,dev);
unregister_netdev(dev) ;
kfree(dev) ;
free_netdev(dev) ;
xl_reset(dev) ;
writel(ACK_INTERRUPT | LATCH_ACK, xl_mmio + MMIO_COMMAND) ;
spin_unlock(&xl_priv->xl_lock) ;
......
......@@ -414,7 +414,7 @@ static int dlci_add(struct dlci_add *dlci)
err2:
rtnl_unlock();
kfree(master);
free_netdev(master);
err1:
dev_put(slave);
return(err);
......
......@@ -1095,7 +1095,7 @@ static int fr_del_pvc(hdlc_device *hdlc, unsigned int dlci, int type)
if (dev->flags & IFF_UP)
return -EBUSY; /* PVC in use */
unregister_netdevice(dev); /* the destructor will kfree(dev) */
unregister_netdevice(dev); /* the destructor will free_netdev(dev) */
*get_dev_p(pvc, type) = NULL;
if (!pvc_is_used(pvc)) {
......@@ -1119,7 +1119,8 @@ static void fr_destroy(hdlc_device *hdlc)
while (pvc) {
pvc_device *next = pvc->next;
if (pvc->main) /* the destructor will kfree(main + ether) */
/* destructors will free_netdev() main and ether */
if (pvc->main)
unregister_netdevice(pvc->main);
if (pvc->ether)
......
......@@ -1580,7 +1580,7 @@ static void wl3501_detach(dev_link_t *link)
*linkp = link->next;
if (link->priv)
kfree(link->priv);
free_netdev(link->priv);
kfree(link);
out:
return;
......
......@@ -360,7 +360,7 @@ lcs_cleanup_card(struct lcs_card *card)
kfree(ipm_list);
}
#endif
kfree(card->dev);
free_netdev(card->dev);
/* Cleanup channels. */
lcs_cleanup_channel(&card->write);
lcs_cleanup_channel(&card->read);
......@@ -1859,8 +1859,8 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
lcs_stopcard(card);
return 0;
out:
lcs_cleanup_channel(&card->read);
lcs_cleanup_channel(&card->write);
lcs_cleanup_channel(&card->read);
lcs_free_card(card);
return -ENODEV;
}
......
......@@ -838,7 +838,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
usb_free_urb(catc->rx_urb);
if (catc->irq_urb)
usb_free_urb(catc->irq_urb);
kfree(netdev);
free_netdev(netdev);
kfree(catc);
return -ENOMEM;
}
......@@ -943,7 +943,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
usb_free_urb(catc->tx_urb);
usb_free_urb(catc->rx_urb);
usb_free_urb(catc->irq_urb);
kfree(netdev);
free_netdev(netdev);
kfree(catc);
return -EIO;
}
......
......@@ -1150,7 +1150,7 @@ static int kaweth_probe(
err_only_tx:
usb_free_urb(kaweth->tx_urb);
err_no_urb:
kfree(netdev);
free_netdev(netdev);
err_no_netdev:
kfree(kaweth);
return -EIO;
......
......@@ -1283,7 +1283,7 @@ static int pegasus_probe(struct usb_interface *intf,
usb_set_intfdata(intf, NULL);
free_skb_pool(pegasus);
out3:
kfree(net);
free_netdev(net);
out2:
free_all_urbs(pegasus);
out1:
......
......@@ -852,7 +852,7 @@ static int rtl8150_probe(struct usb_interface *intf,
free_all_urbs(dev);
out:
kfree(dev->intr_buff);
kfree(netdev);
free_netdev(netdev);
kfree(dev);
return -EIO;
}
......
......@@ -2922,7 +2922,7 @@ static void usbnet_disconnect (struct usb_interface *intf)
if (dev->driver_info->unbind)
dev->driver_info->unbind (dev, intf);
kfree(dev->net);
free_netdev(dev->net);
kfree (dev);
usb_put_dev (xdev);
}
......@@ -3050,7 +3050,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
if (info->unbind)
info->unbind (dev, udev);
out2:
kfree(net);
free_netdev(net);
out1:
kfree(dev);
out:
......
......@@ -566,7 +566,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
goto out_put_dev;
out_free_newdev:
kfree(new_dev);
free_netdev(new_dev);
out_unlock:
rtnl_unlock();
......
......@@ -798,7 +798,7 @@ lecd_attach(struct atm_vcc *vcc, int arg)
return -ENOMEM;
snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i);
if (register_netdev(dev_lec[i])) {
kfree(dev_lec[i]);
free_netdev(dev_lec[i]);
return -EINVAL;
}
......
......@@ -501,7 +501,7 @@ static int bnep_session(void *arg)
__bnep_unlink_session(s);
up_write(&bnep_session_sem);
kfree(dev);
free_netdev(dev);
return 0;
}
......@@ -588,7 +588,7 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
failed:
up_write(&bnep_session_sem);
kfree(dev);
free_netdev(dev);
return err;
}
......
......@@ -280,7 +280,7 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int
nt->parms = *parms;
if (register_netdevice(dev) < 0) {
kfree(dev);
free_netdev(dev);
goto failed;
}
......@@ -1276,7 +1276,7 @@ int __init ipgre_init(void)
return err;
fail:
inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
kfree(ipgre_fb_tunnel_dev);
free_netdev(ipgre_fb_tunnel_dev);
goto out;
}
......
......@@ -250,7 +250,7 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c
nt->parms = *parms;
if (register_netdevice(dev) < 0) {
kfree(dev);
free_netdev(dev);
goto failed;
}
......@@ -899,7 +899,7 @@ int __init ipip_init(void)
return err;
fail:
xfrm4_tunnel_deregister(&ipip_handler);
kfree(ipip_fb_tunnel_dev);
free_netdev(ipip_fb_tunnel_dev);
goto out;
}
......
......@@ -206,7 +206,7 @@ static struct net_device *ipmr_reg_vif(void)
reg_vif_setup);
if (register_netdevice(dev)) {
kfree(dev);
free_netdev(dev);
return NULL;
}
dev->iflink = 0;
......
......@@ -245,7 +245,7 @@ ip6_tnl_create(struct ip6_tnl_parm *p, struct ip6_tnl **pt)
t->parms = *p;
if ((err = register_netdevice(dev)) < 0) {
kfree(dev);
free_netdev(dev);
return err;
}
dev_hold(dev);
......@@ -1118,7 +1118,7 @@ int __init ip6_tunnel_init(void)
ip6ip6_fb_tnl_dev->init = ip6ip6_fb_tnl_dev_init;
if ((err = register_netdev(ip6ip6_fb_tnl_dev))) {
kfree(ip6ip6_fb_tnl_dev);
free_netdev(ip6ip6_fb_tnl_dev);
goto fail;
}
return 0;
......
......@@ -187,7 +187,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
nt->parms = *parms;
if (register_netdevice(dev) < 0) {
kfree(dev);
free_netdev(dev);
goto failed;
}
......@@ -838,6 +838,6 @@ int __init sit_init(void)
return err;
fail:
inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
kfree(ipip6_fb_tunnel_dev);
free_netdev(ipip6_fb_tunnel_dev);
goto out;
}
......@@ -224,7 +224,7 @@ struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr)
IRDA_DEBUG(2, "%s(), register_netdev() failed!\n",
__FUNCTION__ );
self = NULL;
kfree(dev);
free_netdev(dev);
} else {
rtnl_lock();
list_add_rcu(&self->dev_list, &irlans);
......
......@@ -60,7 +60,7 @@ void irlan_eth_setup(struct net_device *dev)
dev->hard_start_xmit = irlan_eth_xmit;
dev->get_stats = irlan_eth_get_stats;
dev->set_multicast_list = irlan_eth_set_multicast_list;
dev->destructor = (void (*)(struct net_device *)) kfree;
dev->destructor = free_netdev;
SET_MODULE_OWNER(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment