]> git.baikalelectronics.ru Git - kernel.git/commit
net: ag71xx: Fix a potential double free in error handling paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 26 Dec 2021 17:51:44 +0000 (18:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Dec 2021 12:16:34 +0000 (12:16 +0000)
commitcf331a1b8a15eaa4a5093f920364ebb0634c8b65
treebd55bb91ba242ae10b754ccc4ce110e46660ea17
parentc1817a2a97f25da4361b957a1b103e949e1ca09f
net: ag71xx: Fix a potential double free in error handling paths

'ndev' is a managed resource allocated with devm_alloc_etherdev(), so there
is no need to call free_netdev() explicitly or there will be a double
free().

Simplify all error handling paths accordingly.

Fixes: 0db86ac1cf03 ("net: ethernet: add ag71xx driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/ag71xx.c