mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 15:49:56 +00:00
net: bridge: fix a possible memory leak in __vlan_add
After per-port vlan stats, vlan stats should be released when fail to add vlan Fixes: 9163a0fc1f0c0 ("net: bridge: add support for per-port vlan stats") CC: bridge@lists.linux-foundation.org cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> CC: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Zhang Yu <zhangyu31@baidu.com> Signed-off-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bc0e7cf433
commit
1a3aea2534
@ -303,6 +303,10 @@ out_filt:
|
||||
if (p) {
|
||||
__vlan_vid_del(dev, br, v->vid);
|
||||
if (masterv) {
|
||||
if (v->stats && masterv->stats != v->stats)
|
||||
free_percpu(v->stats);
|
||||
v->stats = NULL;
|
||||
|
||||
br_vlan_put_master(masterv);
|
||||
v->brvlan = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user