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>
This commit is contained in:
xypron.glpk@gmx.de 2016-07-31 09:58:44 +02:00 committed by David S. Miller
parent 59d53bc213
commit 09d306d79d

View File

@ -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);