failover: Add missing check to validate 'slave_dev' in net_failover_slave_unregister
commitf60d53ef5755b8fefc9d11fc6136b79fb0a4a25c
authorYueHaibing <yuehaibing@huawei.com>
Tue, 4 Sep 2018 02:56:26 +0000 (4 02:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:28 +0000 (13 11:08 -0800)
treeae2f235c0b29ad38d06e12b38dd3bd6776a81f34
parente12da4273c6bb59d21ca328d3a4e87d6adeb421f
failover: Add missing check to validate 'slave_dev' in net_failover_slave_unregister

[ Upstream commit 9e7e6cabf371cc008cb2244a04c012b516753693 ]

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/net_failover.c: In function 'net_failover_slave_unregister':
drivers/net/net_failover.c:598:35: warning:
 variable 'primary_dev' set but not used [-Wunused-but-set-variable]

There should check the validity of 'slave_dev'.

Fixes: cfc80d9a1163 ("net: Introduce net_failover driver")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/net_failover.c