diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 0f71a4fe506a8a223e8d3fe38b7d2b8ef490e724..e1da42aaf9de94891e6bff691b129c2e362334fd 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -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; }