[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d8f2aee-ce64-166d-b13d-9791e8d47036@linux.dev>
Date: Tue, 19 Sep 2023 11:06:28 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Cai Huoqing <cai.huoqing@...ux.dev>
Cc: Dan Carpenter <dan.carpenter@...aro.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: hinic: Fix warning-hinic_set_vlan_fliter() warn:
variable dereferenced before check 'hwdev'
On 19/09/2023 03:27, Cai Huoqing wrote:
> '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@...aro.org>
> Closes: https://lore.kernel.org/r/202309112354.pikZCmyk-lkp@intel.com/
> Signed-off-by: Cai Huoqing <cai.huoqing@...ux.dev>
> ---
> v1->v2: Remove 'hwdev' check directly
> v1 link: https://lore.kernel.org/lkml/20230918123401.6951-1-cai.huoqing@linux.dev/
>
> drivers/net/ethernet/huawei/hinic/hinic_port.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c
> index 9406237c461e..f81a43d2cdfc 100644
> --- a/drivers/net/ethernet/huawei/hinic/hinic_port.c
> +++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c
> @@ -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;
>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Powered by blists - more mailing lists