[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PH0PR18MB4039B944D4D822A168428DB6D3259@PH0PR18MB4039.namprd18.prod.outlook.com>
Date: Tue, 25 May 2021 12:51:37 +0000
From: Sudarsana Reddy Kalluru <skalluru@...vell.com>
To: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Ariel Elior <aelior@...vell.com>
CC: GR-everest-linux-l2 <GR-everest-linux-l2@...vell.com>,
"davem@...emloft.ne" <davem@...emloft.ne>,
"kuba@...nel.org" <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()
> -----Original Message-----
> From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> Sent: Tuesday, May 25, 2021 4:30 PM
> To: Ariel Elior <aelior@...vell.com>
> Cc: Sudarsana Reddy Kalluru <skalluru@...vell.com>; GR-everest-linux-l2
> <GR-everest-linux-l2@...vell.com>; davem@...emloft.ne;
> kuba@...nel.org; netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> Subject: [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()
>
> Eliminate the follow smatch warning:
>
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1227
> bnx2x_iov_init_one() warn: missing error code 'err'.
Not sure if it's false positive, variable 'err' is initialized at line 1195.
1194
1195 err = -EIO;
1196 /* verify ari is enabled */
[Changes look ok though]
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> index d21f085..27943b0 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> @@ -1223,8 +1223,10 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int
> int_mode_param,
> goto failed;
>
> /* SR-IOV capability was enabled but there are no VFs*/
> - if (iov->total == 0)
> + if (iov->total == 0) {
> + err = -EINVAL;
> goto failed;
> + }
>
> iov->nr_virtfn = min_t(u16, iov->total, num_vfs_param);
>
> --
> 1.8.3.1
Powered by blists - more mailing lists