Commit aee11891 authored by Stephen Hemminger's avatar Stephen Hemminger

[NET]: free_netdev - pcmcia drivers.

Replace kfree with free_netdev
parent 0b154e97
...@@ -384,8 +384,10 @@ static void tc574_detach(dev_link_t *link) ...@@ -384,8 +384,10 @@ static void tc574_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
} else
kfree(dev); kfree(dev);
} /* tc574_detach */ } /* tc574_detach */
......
...@@ -308,8 +308,10 @@ static void tc589_detach(dev_link_t *link) ...@@ -308,8 +308,10 @@ static void tc589_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
} else
kfree(dev); kfree(dev);
} /* tc589_detach */ } /* tc589_detach */
......
...@@ -267,8 +267,10 @@ static void axnet_detach(dev_link_t *link) ...@@ -267,8 +267,10 @@ static void axnet_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(&info->dev); unregister_netdev(&info->dev);
free_netdev(&info->dev);
} else
kfree(info); kfree(info);
} /* axnet_detach */ } /* axnet_detach */
......
...@@ -329,7 +329,7 @@ static void com20020_detach(dev_link_t *link) ...@@ -329,7 +329,7 @@ static void com20020_detach(dev_link_t *link)
DEBUG(1,"kfree...\n"); DEBUG(1,"kfree...\n");
kfree(dev->priv); kfree(dev->priv);
kfree(dev); free_netdev(dev);
} }
DEBUG(1,"kfree2...\n"); DEBUG(1,"kfree2...\n");
kfree(info); kfree(info);
......
...@@ -365,8 +365,10 @@ static void fmvj18x_detach(dev_link_t *link) ...@@ -365,8 +365,10 @@ static void fmvj18x_detach(dev_link_t *link)
/* Unlink device structure, free pieces */ /* Unlink device structure, free pieces */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
} else
kfree(dev); kfree(dev);
} /* fmvj18x_detach */ } /* fmvj18x_detach */
......
...@@ -306,7 +306,7 @@ static void ibmtr_detach(dev_link_t *link) ...@@ -306,7 +306,7 @@ static void ibmtr_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
unregister_netdev(dev); unregister_netdev(dev);
kfree(dev); free_netdev(dev);
} /* ibmtr_detach */ } /* ibmtr_detach */
/*====================================================================== /*======================================================================
......
...@@ -579,8 +579,10 @@ static void nmclan_detach(dev_link_t *link) ...@@ -579,8 +579,10 @@ static void nmclan_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
} else
kfree(dev); kfree(dev);
} /* nmclan_detach */ } /* nmclan_detach */
......
...@@ -367,8 +367,10 @@ static void pcnet_detach(dev_link_t *link) ...@@ -367,8 +367,10 @@ static void pcnet_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(&info->dev); unregister_netdev(&info->dev);
free_netdev(&info->dev);
} else
kfree(info); kfree(info);
} /* pcnet_detach */ } /* pcnet_detach */
......
...@@ -443,8 +443,10 @@ static void smc91c92_detach(dev_link_t *link) ...@@ -443,8 +443,10 @@ static void smc91c92_detach(dev_link_t *link)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
} else
kfree(dev); kfree(dev);
} /* smc91c92_detach */ } /* smc91c92_detach */
......
...@@ -699,8 +699,10 @@ xirc2ps_detach(dev_link_t * link) ...@@ -699,8 +699,10 @@ xirc2ps_detach(dev_link_t * link)
/* Unlink device structure, free it */ /* Unlink device structure, free it */
*linkp = link->next; *linkp = link->next;
if (link->dev) if (link->dev) {
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
} else
kfree(dev); kfree(dev);
} /* xirc2ps_detach */ } /* xirc2ps_detach */
......
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