]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: stmmac: dwmac-socfpga: fix use-after-free on probe errors
authorJohan Hovold <johan@kernel.org>
Wed, 30 Nov 2016 14:29:49 +0000 (15:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Dec 2016 15:42:45 +0000 (10:42 -0500)
commita82f90b1491bd5f9a8f55313995b1921a5039593
tree8de0fca290b069bc9c2dbb07b7ee34a946f131e5
parent3f3a8854d71029af7aa4be66a2590dd1d8d6c4b9
net: ethernet: stmmac: dwmac-socfpga: fix use-after-free on probe errors

Make sure to call stmmac_dvr_remove() before returning on late probe
errors so that memory is freed, clocks are disabled, and the netdev is
deregistered before its resources go away.

Fixes: f2886db2f5aa ("net: stmmac: socfpga: Remove re-registration of
reset controller")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c