[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 6 Jun 2023 17:20:37 +0000
From: "Mekala, SunithaX D" <sunithax.d.mekala@...el.com>
To: Tariq Toukan <ttoukan.linux@...il.com>, Simon Horman <horms@...nel.org>,
"Brandeburg, Jesse" <jesse.brandeburg@...el.com>, "Nguyen, Anthony L"
<anthony.l.nguyen@...el.com>
CC: "Mishra, Sudhansu Sekhar" <sudhansu.mishra@...el.com>, "Kolacinski, Karol"
<karol.kolacinski@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Eric Dumazet <edumazet@...gle.com>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "David S. Miller"
<davem@...emloft.net>, Dan Carpenter <dan.carpenter@...aro.org>
Subject: RE: [Intel-wired-lan] [PATCH net] ice: Don't dereference NULL in
ice_gns_read error path
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Tariq Toukan
> Sent: Friday, May 26, 2023 2:48 AM
> To: Simon Horman <horms@...nel.org>; Brandeburg, Jesse <jesse.brandeburg@...el.com>; Nguyen, Anthony L <anthony.l.nguyen@...el.com>
> Cc: Mishra, Sudhansu Sekhar <sudhansu.mishra@...el.com>; Kolacinski, Karol <karol.kolacinski@...el.com>; linux-kernel@...r.kernel.org; Eric Dumazet <edumazet@...gle.com>; intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; David S. Miller <davem@...emloft.net>; Dan Carpenter <dan.carpenter@...aro.org>
> Subject: Re: [Intel-wired-lan] [PATCH net] ice: Don't dereference NULL in ice_gns_read error path
>
>
>
> 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@...nel.org>
>> ---
Tested-by: Sunitha Mekala <sunithax.d.mekala@...el.com> (A Contingent worker at Intel)
Powered by blists - more mailing lists