summaryrefslogtreecommitdiff
path: root/drivers/net/net_failover.c
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2020-06-02 15:55:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-17 17:40:19 +0300
commitc8e374ee609542d083e88ae3ac701c81ec7465fd (patch)
tree1d57f055a774e1930ab40f5abea02990e4835a58 /drivers/net/net_failover.c
parent5ab453bb7b2923b8999962ce0a145b13457342d7 (diff)
downloadlinux-c8e374ee609542d083e88ae3ac701c81ec7465fd.tar.xz
net_failover: fixed rollback in net_failover_open()
[ Upstream commit e8224bfe77293494626f6eec1884fee7b87d0ced ] 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: cfc80d9a1163 ("net: Introduce net_failover driver") Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/net_failover.c')
-rw-r--r--drivers/net/net_failover.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index b16a1221d19b..fb182bec8f06 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -61,7 +61,8 @@ static int net_failover_open(struct net_device *dev)
return 0;
err_standby_open:
- dev_close(primary_dev);
+ if (primary_dev)
+ dev_close(primary_dev);
err_primary_open:
netif_tx_disable(dev);
return err;