mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-06 03:10:56 +00:00
veth: fix a NULL deref in netif_carrier_off
In commit d0e2c55e7c94 (veth: avoid a NULL deref in veth_stats_one) we now clear the peer pointers in veth_dellink() veth_close() must therefore make sure the peer pointer is set. Reported-by: Tom Parkin <tom.parkin@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1f1e495806
commit
2efd32ee1b
@ -206,9 +206,11 @@ static int veth_open(struct net_device *dev)
|
||||
static int veth_close(struct net_device *dev)
|
||||
{
|
||||
struct veth_priv *priv = netdev_priv(dev);
|
||||
struct net_device *peer = rtnl_dereference(priv->peer);
|
||||
|
||||
netif_carrier_off(dev);
|
||||
netif_carrier_off(rtnl_dereference(priv->peer));
|
||||
if (peer)
|
||||
netif_carrier_off(peer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user