net: hinic: Fix warning-hinic_set_vlan_fliter() warn: variable dereferenced before...
authorCai Huoqing <cai.huoqing@linux.dev>
Tue, 19 Sep 2023 02:27:15 +0000 (10:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Sep 2023 09:54:45 +0000 (10:54 +0100)
commit22b6e7f3d6d51ff2716480f3d8f3098d90d69165
treea530c8e179956c0571b3b3330af42c98d46e091f
parent4e4b1798cc90e376b8b61d0098b4093898a32227
net: hinic: Fix warning-hinic_set_vlan_fliter() warn: variable dereferenced before check 'hwdev'

'hwdev' is checked too late and hwdev will not be NULL, so remove the check

Fixes: 2acf960e3be6 ("net: hinic: Add support for configuration of rx-vlan-filter by ethtool")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202309112354.pikZCmyk-lkp@intel.com/
Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/huawei/hinic/hinic_port.c