From: Jeff Garzik Date: Wed, 27 Aug 2008 09:54:30 +0000 (-0400) Subject: [netdrvr] smc91x: fix resource removal (null ptr deref) X-Git-Tag: v2.6.27-rc5~8^2~4^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fc30db563c57e383ca2ec836d8c9208c52d265a;p=linux-2.6 [netdrvr] smc91x: fix resource removal (null ptr deref) Properly handle resource cleanup on unplug/exit. Spotted by Jonathan Cameron Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 2040965d77..24768c10ca 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -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);