[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1469951924-20276-1-git-send-email-xypron.glpk@gmx.de>
Date: Sun, 31 Jul 2016 09:58:44 +0200
From: Heinrich Schuchardt <xypron.glpk@....de>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Heinrich Schuchardt <xypron.glpk@....de>
Subject: [PATCH 1/1] net: ethernet: ax88796: avoid null pointer dereference
If platform_get_resource fails, mem2 is null.
Do not dereference null.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@....de>
---
drivers/net/ethernet/8390/ax88796.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index 5698f53..39ca935 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -910,7 +910,8 @@ static int ax_probe(struct platform_device *pdev)
iounmap(ax->map2);
exit_mem2:
- release_mem_region(mem2->start, mem2_size);
+ if (mem2)
+ release_mem_region(mem2->start, mem2_size);
exit_mem1:
iounmap(ei_local->mem);
--
2.8.1
Powered by blists - more mailing lists