public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Denis Arefev <arefev@swemel.ru>
Cc: Simon Horman <simon.horman@netronome.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	oss-drivers@netronome.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, lvc-patchest@linuxtesting.org,
	trufanov@swemel.ru, vfh@swemel.ru,
	Yinjun Zhang <yinjun.zhang@corigine.com>
Subject: Re: [PATCH v2] lag_conf: Added pointer check and continue
Date: Wed, 16 Nov 2022 10:39:54 +0100	[thread overview]
Message-ID: <Y3Sv6oZgi3k5VaLz@corigine.com> (raw)
In-Reply-To: <20221116081336.83373-1-arefev@swemel.ru>

On Wed, Nov 16, 2022 at 11:13:36AM +0300, Denis Arefev wrote:
> Return value of a function 'kmalloc_array' is dereferenced at
> lag_conf.c:347 without checking for null,
> but it is usually checked for this function.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Denis Arefev <arefev@swemel.ru>

Thanks Denis,

I'll let me colleague Yinjun review the functional change,
although, based on his earlier feedback, it does look good to me.

From my side I have two nits:

1. I think the patch prefix should be 'nfp: flower:'
   i.e., the patch subject should be more like
   [PATCH v2] nfp: flower: handle allocation failure in LAG delayed work

2. Inline, below.

Kind regards,
Simon

> diff --git a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c
> index 63907aeb3884..1aaec4cb9f55 100644
> --- a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c
> +++ b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c
> @@ -276,7 +276,7 @@ static void nfp_fl_lag_do_work(struct work_struct *work)
> 
>         mutex_lock(&lag->lock);
>         list_for_each_entry_safe(entry, storage, &lag->group_list, list) {
> -               struct net_device *iter_netdev, **acti_netdevs;
> +               struct net_device *iter_netdev, **acti_netdevs = NULL;

2. I don't think it is necessary (or therefore desirable)
   to initialise acti_netdevs to NULL.
   As far as I can tell the variable is already always
   set before being used.

...

  reply	other threads:[~2022-11-16  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  8:13 [PATCH v2] lag_conf: Added pointer check and continue Denis Arefev
2022-11-16  9:39 ` Simon Horman [this message]
2022-11-16 10:35   ` Simon Horman
2022-11-18  3:47   ` Jakub Kicinski

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=Y3Sv6oZgi3k5VaLz@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=arefev@swemel.ru \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-patchest@linuxtesting.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=simon.horman@netronome.com \
    --cc=trufanov@swemel.ru \
    --cc=vfh@swemel.ru \
    --cc=yinjun.zhang@corigine.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox