From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v3 net-next] veth: Free queues on link delete Date: Wed, 15 Aug 2018 08:46:41 -0600 Message-ID: <9c318199-ba21-541c-a5d2-7c5e96fcb722@gmail.com> References: <1534320449-2433-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, dsahern@kernel.org To: Toshiaki Makita , "David S. Miller" Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:35340 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729282AbeHORjL (ORCPT ); Wed, 15 Aug 2018 13:39:11 -0400 Received: by mail-pg1-f196.google.com with SMTP id w10-v6so619565pgv.2 for ; Wed, 15 Aug 2018 07:46:44 -0700 (PDT) In-Reply-To: <1534320449-2433-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 8/15/18 2:07 AM, Toshiaki Makita wrote: > David Ahern reported memory leak in veth. > ... > veth_rq allocated in veth_newlink() was not freed on dellink. > > We need to free up them after veth_close() so that any packets will not > reference the queues afterwards. Thus free them in veth_dev_free() in > the same way as freeing stats structure (vstats). > > Also move queues allocation to veth_dev_init() to be in line with stats > allocation. > > Fixes: 638264dc90227 ("veth: Support per queue XDP ring") > Reported-by: David Ahern > Signed-off-by: Toshiaki Makita > --- > This is a fix for a bug which exists only in net-next. > Let me know if I should wait for -next merging into net or reopen of -next. > > drivers/net/veth.c | 70 +++++++++++++++++++++++++----------------------------- > 1 file changed, 33 insertions(+), 37 deletions(-) > Reviewed-by: David Ahern Tested-by: David Ahern