bond_3ad.c avoid possible null deref
authorDan Carpenter <error27@gmail.com>
Wed, 23 Dec 2009 03:27:10 +0000 (03:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Dec 2009 04:24:46 +0000 (20:24 -0800)
A few lines earlier we assume that best->slave could be either null or non-null so
we should check it here as well.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_3ad.c

index 0fb7a4964e7560c93d2a44fbd85d925646690099..822f586d72afa67d8abd5c606f38b11f60f0147d 100644 (file)
@@ -1580,7 +1580,7 @@ static void ad_agg_selection_logic(struct aggregator *agg)
                // 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;