netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] bond_3ad.c avoid possible null deref
@ 2009-12-23 13:27 Dan Carpenter
  2009-12-27  4:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-12-23 13:27 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: bonding-devel, netdev

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>

--- orig/drivers/net/bonding/bond_3ad.c	2009-12-23 00:06:58.000000000 +0200
+++ devel/drivers/net/bonding/bond_3ad.c	2009-12-23 00:07:31.000000000 +0200
@@ -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;

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

* Re: [patch] bond_3ad.c avoid possible null deref
  2009-12-23 13:27 [patch] bond_3ad.c avoid possible null deref Dan Carpenter
@ 2009-12-27  4:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-12-27  4:26 UTC (permalink / raw)
  To: error27; +Cc: fubar, bonding-devel, netdev

From: Dan Carpenter <error27@gmail.com>
Date: Wed, 23 Dec 2009 15:27:10 +0200

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

Applied.

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

end of thread, other threads:[~2009-12-27  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23 13:27 [patch] bond_3ad.c avoid possible null deref Dan Carpenter
2009-12-27  4:26 ` David Miller

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