[netdrvr] smc91x: fix resource removal (null ptr deref)
authorJeff Garzik <jeff@garzik.org>
Wed, 27 Aug 2008 09:54:30 +0000 (05:54 -0400)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 27 Aug 2008 09:54:30 +0000 (05:54 -0400)
Properly handle resource cleanup on unplug/exit.

Spotted by Jonathan Cameron

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/smc91x.c

index 2040965d7724bc29fd0cc92532ca9e65dded071c..24768c10cadb7d1e326b3651ce6819ec08021699 100644 (file)
@@ -2255,7 +2255,7 @@ static int smc_drv_remove(struct platform_device *pdev)
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs");
        if (!res)
-               platform_get_resource(pdev, IORESOURCE_MEM, 0);
+               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        release_mem_region(res->start, SMC_IO_EXTENT);
 
        free_netdev(ndev);