Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Gal Pressman <gal.pressman@linux.dev>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, tariqt@nvidia.com
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mlx4: Fix missing error code in mlx4_load_one()
Date: Sun, 25 Jul 2021 11:37:38 +0300	[thread overview]
Message-ID: <9a9cfded-cbce-b36d-77f1-020caeaf6052@linux.dev> (raw)
In-Reply-To: <1627036569-71880-1-git-send-email-jiapeng.chong@linux.alibaba.com>

On 23/07/2021 13:36, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/mellanox/mlx4/main.c:3538 mlx4_load_one() warn:
> missing error code 'err'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 7ae0e400cd93 ("net/mlx4_core: Flexible (asymmetric) allocation of
> EQs and MSI-X vectors for PF/VFs")

Fixes line shouldn't be wrapped.

> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 00c8465..28ac469 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -3535,6 +3535,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
>  
>  		if (!SRIOV_VALID_STATE(dev->flags)) {
>  			mlx4_err(dev, "Invalid SRIOV state\n");
> +			err = -EINVAL;
>  			goto err_close;
>  		}
>  	}
> 

I think this patch is missing a few occurrences:
https://elixir.bootlin.com/linux/v5.14-rc2/source/drivers/net/ethernet/mellanox/mlx4/main.c#L3455
https://elixir.bootlin.com/linux/v5.14-rc2/source/drivers/net/ethernet/mellanox/mlx4/main.c#L3468
https://elixir.bootlin.com/linux/v5.14-rc2/source/drivers/net/ethernet/mellanox/mlx4/main.c#L3490

  parent reply	other threads:[~2021-07-25  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 10:36 Jiapeng Chong
2021-07-25  6:15 ` Tariq Toukan
2021-07-25  8:37 ` Gal Pressman [this message]
2021-07-25  9:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a9cfded-cbce-b36d-77f1-020caeaf6052@linux.dev \
    --to=gal.pressman@linux.dev \
    --cc=davem@davemloft.net \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@nvidia.com \
    --subject='Re: [PATCH] mlx4: Fix missing error code in mlx4_load_one()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).