提交 0ddcbbf4 编写于 作者: Y YueHaibing 提交者: Greg Kroah-Hartman

failover: Fix error return code in net_failover_create

[ Upstream commit 09317da317e55e70ccbe23f65008348a4a1b7c7f ]

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

Fixes: cfc80d9a ("net: Introduce net_failover driver")
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 eca5b74e
......@@ -765,8 +765,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册