From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Buslov Subject: Re: [PATCH net-next v6 08/11] net: sched: don't release reference on action overwrite Date: Tue, 14 Aug 2018 20:23:53 +0300 Message-ID: References: <1530800673-12280-1-git-send-email-vladbu@mellanox.com> <1530800673-12280-9-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Yevgeny Kliteynik , Jiri Pirko To: Cong Wang Return-path: Received: from mail-eopbgr00054.outbound.protection.outlook.com ([40.107.0.54]:24400 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388409AbeHNUOZ (ORCPT ); Tue, 14 Aug 2018 16:14:25 -0400 In-reply-to: Sender: netdev-owner@vger.kernel.org List-ID: On Mon 13 Aug 2018 at 23:00, Cong Wang wrote: > On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: >> diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c >> index 89a761395c94..acea3feae762 100644 >> --- a/net/sched/act_ife.c >> +++ b/net/sched/act_ife.c > ... >> @@ -548,6 +546,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, >> >> if (exists) >> spin_unlock_bh(&ife->tcf_lock); >> + tcf_idr_release(*a, bind); >> + >> kfree(p); >> return err; >> } > > With this change, you seem release it twice when nla_parse_nested() fails > for ACT_P_CREATED case...? Thank you, great catch! > > Looks like what you want is the following? > > if (err) { > tcf_idr_release(*a, bind); > kfree(p); > return err; > } Yes. Sending the fix.