From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Simon Horman <horms@kernel.org>,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Karol Kolacinski <karol.kolacinski@intel.com>,
Sudhansu Sekhar Mishra <sudhansu.mishra@intel.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] ice: Don't dereference NULL in ice_gns_read error path
Date: Fri, 26 May 2023 12:48:15 +0300 [thread overview]
Message-ID: <e1e3dea5-a393-180a-805a-a944ec778041@gmail.com> (raw)
In-Reply-To: <20230525-null-ice-v1-1-30d10557b91e@kernel.org>
On 25/05/2023 13:52, Simon Horman wrote:
> If pf is NULL in ice_gns_read() then it will be dereferenced
> in the error path by a call to dev_dbg(ice_pf_to_dev(pf), ...).
>
> Avoid this by simply returning in this case.
> If logging is desired an alternate approach might be to
> use pr_err() before returning.
>
> Flagged by Smatch as:
>
> .../ice_gnss.c:196 ice_gnss_read() error: we previously assumed 'pf' could be null (see line 131)
>
> Fixes: 43113ff73453 ("ice: add TTY for GNSS module for E810T device")
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
LGTM.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
next prev parent reply other threads:[~2023-05-26 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 10:52 [PATCH net] ice: Don't dereference NULL in ice_gns_read error path Simon Horman
2023-05-26 9:48 ` Tariq Toukan [this message]
2023-06-06 17:20 ` [Intel-wired-lan] " Mekala, SunithaX D
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=e1e3dea5-a393-180a-805a-a944ec778041@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=anthony.l.nguyen@intel.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=karol.kolacinski@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sudhansu.mishra@intel.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;
as well as URLs for NNTP newsgroup(s).