netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ice: Fix NULL pointer access, if PF doesn't support SRIOV_LAG
@ 2024-08-26  8:58 Thomas Bogendoerfer
  2024-08-26  9:41 ` Jiri Pirko
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Bogendoerfer @ 2024-08-26  8:58 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, intel-wired-lan, netdev,
	linux-kernel

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.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 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;
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-03 21:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26  8:58 [PATCH net] ice: Fix NULL pointer access, if PF doesn't support SRIOV_LAG Thomas Bogendoerfer
2024-08-26  9:41 ` Jiri Pirko
2024-08-26 10:17   ` Thomas Bogendoerfer
2024-08-26 11:17     ` Jiri Pirko
2024-08-27  7:16     ` Przemek Kitszel
2024-08-27 19:12       ` Thomas Bogendoerfer
2024-08-28  8:14         ` Przemek Kitszel
2024-08-30 17:12         ` Ertman, David M
2024-09-03 21:43           ` Thomas Bogendoerfer

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).