netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] bonding: fix a memory leak in bond_arp_send_all()
@ 2014-07-25 12:21 Dan Carpenter
  2014-07-25 12:24 ` Veaceslav Falico
  2014-07-29  0:28 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-07-25 12:21 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico; +Cc: Andy Gospodarek, netdev, kernel-janitors

This test is reversed so the memory is always leaked.  It's better style
to remove the test anyway.

Fixes: 3e403a77779f ('bonding: make it possible to have unlimited nested upper vlans')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 023ec36..f0f5eab 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2287,8 +2287,7 @@ found:
 		ip_rt_put(rt);
 		bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
 			      addr, tags);
-		if (!tags)
-			kfree(tags);
+		kfree(tags);
 	}
 }
 

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

end of thread, other threads:[~2014-07-29  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 12:21 [patch] bonding: fix a memory leak in bond_arp_send_all() Dan Carpenter
2014-07-25 12:24 ` Veaceslav Falico
2014-07-29  0:28 ` 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).