diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-09-06 21:04:12 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-08 10:28:56 -0700 |
commit | 09317da317e55e70ccbe23f65008348a4a1b7c7f (patch) | |
tree | 3d271895565ffbd10049f4f4f2754a5aa6007024 /drivers/net/net_failover.c | |
parent | cc577b01ba12b07733eaf3b7590256fefe42236d (diff) | |
download | linux-rt-09317da317e55e70ccbe23f65008348a4a1b7c7f.tar.gz |
failover: Fix error return code in net_failover_create
if failover_register failed, 'err' code should be set correctly
Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/net_failover.c')
-rw-r--r-- | drivers/net/net_failover.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c index 8524fe4fddea..e964d312f4ca 100644 --- a/drivers/net/net_failover.c +++ b/drivers/net/net_failover.c @@ -764,8 +764,10 @@ struct failover *net_failover_create(struct net_device *standby_dev) netif_carrier_off(failover_dev); failover = failover_register(failover_dev, &net_failover_ops); - if (IS_ERR(failover)) + if (IS_ERR(failover)) { + err = PTR_ERR(failover); goto err_failover_register; + } return failover; |