public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Daniel Machon <daniel.machon@microchip.com>,
	Dave Ertman <david.m.ertman@intel.com>,
	<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 net] ice: Fix NULL pointer access, if PF doesn't support SRIOV_LAG
Date: Wed, 28 Aug 2024 10:20:40 +0200	[thread overview]
Message-ID: <cca70257-b8bf-4d4f-9a0e-b5116536734e@intel.com> (raw)
In-Reply-To: <51b220a9-3304-4baf-a2fc-8da8d765aff7@intel.com>

On 8/27/24 11:52, Przemek Kitszel wrote:
> On 8/27/24 09:16, Thomas Bogendoerfer wrote:
>> For PFs, which don't support SRIOV_LAG, there is no pf->lag struct
>> allocated. So before accessing pf->lag a NULL pointer check is needed.
>>
>> Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for 
>> SRIOV on bonded interface")
>> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>> ---
>> v2:
>>   - Added Fixes tag
>> v1: 
>> https://lore.kernel.org/netdev/20240826085830.28136-1-tbogendoerfer@suse.de/
> 
> Please see my reply to v1, unfortunately sent at the same time as your
> v2. The fixes tag should be different. The check that you have
> introduced here repeats the check in the only caller (was not effective
> though).
> 
>>
>>   drivers/net/ethernet/intel/ice/ice_lag.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c 
>> b/drivers/net/ethernet/intel/ice/ice_lag.c
>> index 1ccb572ce285..916a16a379a8 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_lag.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_lag.c
>> @@ -704,7 +704,7 @@ void ice_lag_move_new_vf_nodes(struct ice_vf *vf)
>>       lag = pf->lag;
>>       mutex_lock(&pf->lag_mutex);
>> -    if (!lag->bonded)
>> +    if (!lag || !lag->bonded)
>>           goto new_vf_unlock;
>>       pri_port = pf->hw.port_info->lport;
> 
> 

thank you,
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

      reply	other threads:[~2024-08-28  8:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  7:16 [PATCH v2 net] ice: Fix NULL pointer access, if PF doesn't support SRIOV_LAG Thomas Bogendoerfer
2024-08-27  7:40 ` Jiri Pirko
2024-08-27  9:52 ` Przemek Kitszel
2024-08-28  8:20   ` Przemek Kitszel [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=cca70257-b8bf-4d4f-9a0e-b5116536734e@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=david.m.ertman@intel.com \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tbogendoerfer@suse.de \
    /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