Commit e8224bfe authored by Vasily Averin's avatar Vasily Averin Committed by David S. Miller

net_failover: fixed rollback in net_failover_open()

found by smatch:
drivers/net/net_failover.c:65 net_failover_open() error:
 we previously assumed 'primary_dev' could be null (see line 43)

Fixes: cfc80d9a ("net: Introduce net_failover driver")
Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 241d46dc
...@@ -61,7 +61,8 @@ static int net_failover_open(struct net_device *dev) ...@@ -61,7 +61,8 @@ static int net_failover_open(struct net_device *dev)
return 0; return 0;
err_standby_open: err_standby_open:
dev_close(primary_dev); if (primary_dev)
dev_close(primary_dev);
err_primary_open: err_primary_open:
netif_tx_disable(dev); netif_tx_disable(dev);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment