From: Jeff Garzik Date: Wed, 27 Aug 2008 09:54:30 +0000 (-0400) Subject: [netdrvr] smc91x: fix resource removal (null ptr deref) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6fc30db563c57e383ca2ec836d8c9208c52d265a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [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 2040965d7724..24768c10cadb 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);