Thread (9 messages) 9 messages, 4 authors, 2024-09-03

Re: [PATCH net] ice: Fix NULL pointer access, if PF doesn't support SRIOV_LAG

From: Jiri Pirko <jiri@resnulli.us>
Date: 2024-08-26 09:41:22
Also in: intel-wired-lan, lkml

Mon, Aug 26, 2024 at 10:58:30AM CEST, tbogendoerfer@suse.de 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.

Signed-off-by: Thomas Bogendoerfer <redacted>
You need to add a "fixes" tag blaming the commit that introduced the
bug.

quoted hunk ↗ jump to hunk
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help