From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: [PATCH] netlink: fix memory leak Date: Sun, 22 Jul 2018 10:12:46 +0200 Message-ID: <20180722081246.udphfijsnfnshrsc@breakpoint.cc> References: <20180722024925.3176-1-cscnull@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: cscnull@gmail.com, Pablo Neira Ayuso , kadlec@blackhole.kfki.hu, Florian Westphal , David Miller , "Berg, Johannes" , Philippe Ombredanne , kstewart@linuxfoundation.org, Greg Kroah-Hartman , dsahern@gmail.com, lucien.xin@gmail.com, ktkhai@virtuozzo.com, Cong Wang , LKML , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Netdev To: "Jason A. Donenfeld" Return-path: Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:60988 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbeGVJI7 (ORCPT ); Sun, 22 Jul 2018 05:08:59 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Jason A. Donenfeld wrote: > On Sun, Jul 22, 2018 at 4:51 AM Shaochun Chen wrote: > But even if you moved it somehow to the if(ret), I'm still not sure > it'd be correct; start cbs should either succeed, or they should error > out and cleanup entirely after themselves. I agree, ->done() should not be called if cb->dump() was never invoked. All ctnetlink and nf_tables spots need to cleanup after themselves.