Commit 22b6e7f3 authored by Cai Huoqing's avatar Cai Huoqing Committed by David S. Miller

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: 2acf960e ("net: hinic: Add support for configuration of rx-vlan-filter by ethtool")
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202309112354.pikZCmyk-lkp@intel.com/Signed-off-by: default avatarCai Huoqing <cai.huoqing@linux.dev>
Reviewed-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e4b1798
......@@ -456,9 +456,6 @@ int hinic_set_vlan_fliter(struct hinic_dev *nic_dev, u32 en)
u16 out_size = sizeof(vlan_filter);
int err;
if (!hwdev)
return -EINVAL;
vlan_filter.func_idx = HINIC_HWIF_FUNC_IDX(hwif);
vlan_filter.enable = en;
......
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