* [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
* Re: [patch] bonding: fix a memory leak in bond_arp_send_all()
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
1 sibling, 0 replies; 3+ messages in thread
From: Veaceslav Falico @ 2014-07-25 12:24 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Jay Vosburgh, Andy Gospodarek, netdev, kernel-janitors
On Fri, Jul 25, 2014 at 03:21:21PM +0300, Dan Carpenter wrote:
>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>
Indeed, dunno how I've missed that. And kfree() verifies for the NULL
situation.
Acked-by: Veaceslav Falico <vfalico@gmail.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 [flat|nested] 3+ messages in thread
* Re: [patch] bonding: fix a memory leak in bond_arp_send_all()
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
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-07-29 0:28 UTC (permalink / raw)
To: dan.carpenter; +Cc: j.vosburgh, vfalico, andy, netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 25 Jul 2014 15:21:21 +0300
> 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>
Applied, but in the future please make "net-next" submissions explicit by saying
something like "[PATCH net-next] " in your subject.
Thanks.
^ permalink raw reply [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).