mirror of https://gitee.com/openkylin/linux.git
failover: Fix error return code in net_failover_create
if failover_register failed, 'err' code should be set correctly
Fixes: cfc80d9a11
("net: Introduce net_failover driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cc577b01ba
commit
09317da317
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue