Skip to contentSkip to conversation

bond_3ad.c avoid possible null deref

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 23, 2009 – Dec 27, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bond_3ad.c avoid possible null deref

A few lines earlier we assume that best->slave could be either null or non-null so we should check it here as well.

drivers/net/bonding/bond_3ad.c +1 -1
@@ -1580,7 +1580,7 @@ static void ad_agg_selection_logic(struc
 		// check if any partner replys
 		if (best->is_individual) {
 			pr_warning("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",
-				   best->slave->dev->master->name);
+				   best->slave ? best->slave->dev->master->name : "NULL");
 		}
 
 		best->is_active = 1;