Commit 09317da3 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

failover: Fix error return code in net_failover_create

if failover_register failed, 'err' code should be set correctly

Fixes: cfc80d9a ("net: Introduce net_failover driver")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc577b01
......@@ -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;
......
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