[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <822fcc88-a8d5-f27e-88c1-32a55a6f9b0e@cumulusnetworks.com>
Date: Mon, 15 Oct 2018 14:13:38 +0300
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Li RongQing <lirongqing@...du.com>, netdev@...r.kernel.org
Cc: bridge@...ts.linux-foundation.org, roopa@...ulusnetworks.com
Subject: Re: [PATCH][net-next][v2] net: bridge: fix a possible memory leak in
__vlan_add
On 15/10/2018 14:00, Li RongQing wrote:
> 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@...ts.linux-foundation.org
> cc: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
> CC: Roopa Prabhu <roopa@...ulusnetworks.com>
> Signed-off-by: Zhang Yu <zhangyu31@...du.com>
> Signed-off-by: Li RongQing <lirongqing@...du.com>
> ---
> net/bridge/br_vlan.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
> index 9b707234e4ae..8c9297a01947 100644
> --- a/net/bridge/br_vlan.c
> +++ b/net/bridge/br_vlan.c
> @@ -303,6 +303,10 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags)
> 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;
> }
>
Thanks,
Signed-off-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Powered by blists - more mailing lists