Skip to content

Commit 22b6e7f

Browse files
caihuoqdavem330
authored andcommitted
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: 2acf960 ("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>
1 parent 4e4b179 commit 22b6e7f

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/net/ethernet/huawei/hinic/hinic_port.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,6 @@ int hinic_set_vlan_fliter(struct hinic_dev *nic_dev, u32 en)
456456
u16 out_size = sizeof(vlan_filter);
457457
int err;
458458

459-
if (!hwdev)
460-
return -EINVAL;
461-
462459
vlan_filter.func_idx = HINIC_HWIF_FUNC_IDX(hwif);
463460
vlan_filter.enable = en;
464461

0 commit comments

Comments
 (0)