From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drivers: base: swnode: check if swnode is null before dereferencing it
Date: Wed, 02 Jan 2019 12:01:13 +0000 [thread overview]
Message-ID: <20190102120113.GN3781@kadam> (raw)
In-Reply-To: <20181222124333.13561-1-colin.king@canonical.com>
On Sat, Dec 22, 2018 at 12:43:33PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The macro to_software_mode can potentially return NULL, so also add
> a null check on the swnode before dereferencing it to avoid any null
> pointer dereferences.
>
> Detected by CoverityScan, CID#1476052 ("Explicit null dereferenced")
>
> Fixes: 59abd83672f7 ("drivers: base: Introducing software nodes to the firmware node framework")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
to_software_mode() can't return NULL though...
We shouldn't change the code just to make the static checker happy.
Sometimes if we just silence every static checker warning maybe we will
fix some bugs in the middle of silencing all the false positive, but
Smatch is almost at the stage of being able to parse this code
correctly. Maybe by the end of the year. So let's hold off and then
think about taking the fix everything approach next year.
regards,
dan carpenter
prev parent reply other threads:[~2019-01-02 12:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-22 12:43 [PATCH][next] drivers: base: swnode: check if swnode is null before dereferencing it Colin King
2018-12-27 8:59 ` Rafael J. Wysocki
2019-01-02 12:01 ` Dan Carpenter [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=20190102120113.GN3781@kadam \
--to=dan.carpenter@oracle.com \
--cc=colin.king@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@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