lkml.org 
[lkml]   [2003]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: misc au1000 cleanups.
davej@codemonkey.org.uk wrote:
> - Missing release region
> - Unneeded initialisation of private struct
> (already done in init_etherdev)
> - Remove unneeded freeing of dev->priv
> (auto-free'd by kfree(dev)
> - actually kfree (dev), plugging leak.
>
> diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/net/au1000_eth.c linux-2.5/drivers/net/au1000_eth.c
> --- bk-linus/drivers/net/au1000_eth.c 2003-03-08 09:57:14.000000000 +0000
> +++ linux-2.5/drivers/net/au1000_eth.c 2003-02-20 12:16:32.000000000 +0000
> @@ -675,37 +675,24 @@ au1000_probe1(struct net_device *dev, lo
> char *pmac, *argptr;
> char ethaddr[6];
>
> - if (!request_region(ioaddr, MAC_IOSIZE, "Au1000 ENET")) {
> + if (!request_region(ioaddr, MAC_IOSIZE, "Au1000 ENET"))
> return -ENODEV;
> - }
>
> if (version_printed++ == 0) printk(version);
>
> - if (!dev) {
> + if (!dev)
> dev = init_etherdev(0, sizeof(struct au1000_private));
> - }
> +
> if (!dev) {
> - printk (KERN_ERR "au1000 eth: init_etherdev failed\n");
> - return -ENODEV;
> + printk (KERN_ERR "au1000 eth: init_etherdev failed\n");
> + release_region(ioaddr, MAC_IOSIZE);
> + return -ENODEV;
> }


'dev' is always NULL as passed to the function... just kill the argument
to the function. Otherwise, looks ok.

Jeff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.633 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site