All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Haowen Bai <baihaowen@meizu.com>
Cc: vireshk@kernel.org, johan@kernel.org, elder@kernel.org,
	gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: Fix potential NULL dereference
Date: Fri, 11 Mar 2022 14:32:08 +0300	[thread overview]
Message-ID: <20220311113208.GK3293@kadam> (raw)
In-Reply-To: <1646987730-7597-1-git-send-email-baihaowen@meizu.com>

On Fri, Mar 11, 2022 at 04:35:30PM +0800, Haowen Bai wrote:
> Fix following coccicheck warning:
> drivers/staging/greybus/bootrom.c:301:35-39: ERROR: fw is NULL but dereferenced.
> 
> When goto queue_work but dereference Uninitialized fw will trigger a NULL 
> dereference.
> 
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>

Your patch claims to fix a bug, but the warning is a false positive.
When we "goto queue_work;" then "ret = -EINVAL" so that means that we
will not dereference "fw".

You should ignore false positive warnings.

We would apply the patch only if it made the code more readable but I
do not think that is the case here.  I do not really even see how the
patch silences the false positive warning, but it may do...

Anyway, the point is:  False positive.  Ignore it.

regards,
dan carpenter


  parent reply	other threads:[~2022-03-11 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11  8:35 [PATCH] staging: greybus: Fix potential NULL dereference Haowen Bai
2022-03-11  8:40 ` Viresh Kumar
2022-03-11  8:50   ` 答复: " 白浩文
2022-03-11 11:32 ` Dan Carpenter [this message]
2022-03-14  1:12   ` 白浩文

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=20220311113208.GK3293@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=baihaowen@meizu.com \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=vireshk@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.