From: 白浩文 <baihaowen@meizu.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "vireshk@kernel.org" <vireshk@kernel.org>,
"johan@kernel.org" <johan@kernel.org>,
"elder@kernel.org" <elder@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 答复: [PATCH] staging: greybus: Fix potential NULL dereference
Date: Mon, 14 Mar 2022 01:12:16 +0000 [thread overview]
Message-ID: <5bbec145aa454874a8ae45091e26c3ca@meizu.com> (raw)
In-Reply-To: <20220311113208.GK3293@kadam>
Thank you for your suggestion.
________________________________________
发件人: Dan Carpenter <dan.carpenter@oracle.com>
发送时间: 2022年3月11日 19:32:08
收件人: 白浩文
抄送: vireshk@kernel.org; johan@kernel.org; elder@kernel.org; gregkh@linuxfoundation.org; linux-staging@lists.linux.dev; linux-kernel@vger.kernel.org
主题: Re: [PATCH] staging: greybus: Fix potential NULL dereference
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
prev parent reply other threads:[~2022-03-14 1:18 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
2022-03-14 1:12 ` 白浩文 [this message]
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=5bbec145aa454874a8ae45091e26c3ca@meizu.com \
--to=baihaowen@meizu.com \
--cc=dan.carpenter@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox