ethtool: Fix an error code in cxgb2.c
authorYang Li <yang.lee@linux.alibaba.com>
Fri, 3 Sep 2021 06:42:33 +0000 (14:42 +0800)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:32:58 +0000 (12:32 +0100)
commita6c5b8bece481a166886e942d9b60090f4922dfc
tree47ad0e5a2395c915a216d988807ff04813649cd3
parent77d9c572f4cedfa9bd3a5532bcd127a6d6e17cd3
ethtool: Fix an error code in cxgb2.c

[ Upstream commit 7db8263a12155c7ae4ad97e850f1e499c73765fc ]

When adapter->registered_device_map is NULL, the value of err is
uncertain, we set err to -EINVAL to avoid ambiguity.

Clean up smatch warning:
drivers/net/ethernet/chelsio/cxgb/cxgb2.c:1114 init_one() warn: missing
error code 'err'

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/chelsio/cxgb/cxgb2.c