Commit 0ddcbbf4 authored by YueHaibing's avatar YueHaibing Committed by Greg Kroah-Hartman

failover: Fix error return code in net_failover_create

[ Upstream commit 09317da3 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent eca5b74e
...@@ -765,8 +765,10 @@ struct failover *net_failover_create(struct net_device *standby_dev) ...@@ -765,8 +765,10 @@ struct failover *net_failover_create(struct net_device *standby_dev)
netif_carrier_off(failover_dev); netif_carrier_off(failover_dev);
failover = failover_register(failover_dev, &net_failover_ops); failover = failover_register(failover_dev, &net_failover_ops);
if (IS_ERR(failover)) if (IS_ERR(failover)) {
err = PTR_ERR(failover);
goto err_failover_register; goto err_failover_register;
}
return failover; 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