bonding: fix a memory leak in bond_arp_send_all()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Jul 2014 12:21:21 +0000 (15:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jul 2014 00:27:47 +0000 (17:27 -0700)
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>
Acked-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c

index 023ec365209c06543d043791194270a95c2c7c35..f0f5eab0fab102bbf3b4417632abcc5bf6082ea8 100644 (file)
@@ -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);
        }
 }