aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>2016-07-31 09:58:44 +0200
committerDavid S. Miller <davem@davemloft.net>2016-08-01 13:32:51 -0700
commit09d306d79dd784415c37363c02b5d9eb0157d9a4 (patch)
treecf3e94839d8f7b29b337296d68fe8f660dc9030e /drivers/net
parentnet: caif: use correct format specifier (diff)
downloadlinux-dev-09d306d79dd784415c37363c02b5d9eb0157d9a4.tar.xz
linux-dev-09d306d79dd784415c37363c02b5d9eb0157d9a4.zip
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@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/8390/ax88796.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index 5698f5354c0b..39ca9350d1b2 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);