net: dpaa2-eth: fix use-after-free in dpaa2_eth_remove
[ Upstream commit 9b5a333272a48c2f8b30add7a874e46e8b26129c ]
Access to netdev after free_netdev() will cause use-after-free bug.
Move debug log before free_netdev() call to avoid it.
Fixes: 7472dd9f64
("staging: fsl-dpaa2/eth: Move print message")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
381a30f7e3
commit
1c4099dc0d
@@ -4432,10 +4432,10 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
|
|||||||
|
|
||||||
fsl_mc_portal_free(priv->mc_io);
|
fsl_mc_portal_free(priv->mc_io);
|
||||||
|
|
||||||
free_netdev(net_dev);
|
|
||||||
|
|
||||||
dev_dbg(net_dev->dev.parent, "Removed interface %s\n", net_dev->name);
|
dev_dbg(net_dev->dev.parent, "Removed interface %s\n", net_dev->name);
|
||||||
|
|
||||||
|
free_netdev(net_dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user