public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: martyn@welchs.me.uk, manohar.vanga@gmail.com,
	alexandre.belloni@bootlin.com, rafael@kernel.org,
	mathieu.poirier@linaro.org, u.kleine-koenig@pengutronix.de,
	arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev, Kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] vme: Added NULL check for bridge
Date: Mon, 20 Jun 2022 10:02:05 +0200	[thread overview]
Message-ID: <YrApfbtMD56WwpIm@kroah.com> (raw)
In-Reply-To: <20220619070645.100947-1-jrdr.linux@gmail.com>

On Sun, Jun 19, 2022 at 12:36:45PM +0530, Souptick Joarder wrote:
> From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>
> 
> Kernel test robot throws below warning ->
> drivers/staging/vme_user/vme.c:662:20: warning: dereference
> of NULL 'bridge' [CWE-476] [-Wanalyzer-null-dereference]
> 
> Added a NULL check.
> 
> Reported-by: Kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
> ---
>  drivers/staging/vme_user/vme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c
> index b5555683a069..ede774f2fe5a 100644
> --- a/drivers/staging/vme_user/vme.c
> +++ b/drivers/staging/vme_user/vme.c
> @@ -659,7 +659,7 @@ ssize_t vme_master_read(struct vme_resource *resource, void *buf, size_t count,
>  	struct vme_master_resource *image;
>  	size_t length;
>  
> -	if (!bridge->master_read) {
> +	if (bridge && !bridge->master_read) {

How can bridge ever be NULL here?

thanks,

greg k-h

  reply	other threads:[~2022-06-20  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19  7:06 [PATCH] vme: Added NULL check for bridge Souptick Joarder
2022-06-20  8:02 ` Greg KH [this message]
2022-06-20  8:49 ` Dan Carpenter

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=YrApfbtMD56WwpIm@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=lkp@intel.com \
    --cc=manohar.vanga@gmail.com \
    --cc=martyn@welchs.me.uk \
    --cc=mathieu.poirier@linaro.org \
    --cc=rafael@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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