From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeJk7-00088m-3h for qemu-devel@nongnu.org; Tue, 22 Sep 2015 05:20:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeJk3-0005y8-CY for qemu-devel@nongnu.org; Tue, 22 Sep 2015 05:20:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeJk3-0005xQ-6d for qemu-devel@nongnu.org; Tue, 22 Sep 2015 05:20:03 -0400 References: <1442405768-23019-1-git-send-email-yanghy@cn.fujitsu.com> <1442405768-23019-13-git-send-email-yanghy@cn.fujitsu.com> <56010511.2040303@redhat.com> <5601080F.9090305@cn.fujitsu.com> <560111E4.9030606@redhat.com> <560112CA.8010502@cn.fujitsu.com> From: Jason Wang Message-ID: <56011D3C.3050504@redhat.com> Date: Tue, 22 Sep 2015 17:19:56 +0800 MIME-Version: 1.0 In-Reply-To: <560112CA.8010502@cn.fujitsu.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v11 12/12] netfilter: add multiqueue support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Hongyang , qemu-devel@nongnu.org Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, armbru@redhat.com, Yang Hongyang , stefanha@redhat.com On 09/22/2015 04:35 PM, Yang Hongyang wrote: > > > On 09/22/2015 04:31 PM, Jason Wang wrote: > [...] >>>>> + /* setup filter */ >>>>> + nfqc = NETFILTER_GET_CLASS(obj); >>>>> + if (nfqc->setup) { >>>>> + nfqc->setup(nfq, &local_err); >>>>> + if (local_err) { >>>>> + error_propagate(errp, local_err); >>>>> + goto out; >>>>> + } >>>>> + } >>>>> + QTAILQ_INSERT_TAIL(&nfq->netdev->filters, nfq, next); >>>>> + object_unref(obj); >>> ^^^^^^^^^^^^ >>> >>>>> + } >>>>> + >>>>> + if (proptable) { >>>>> + g_hash_table_unref(proptable); >>>>> + } >>>>> + return; >>>>> + >>>>> +out: >>>> >>>> We may leak objects here. >>> >>> Seems not. see above object_unref(), if we come to >>> here, object create in previous iter will be unrefed. >> >> Maybe I miss something. But there's still refcnt for objects created in >> previous iters? (I mean object_property_add_child() will add another >> refcnt?) > > This is intended, parent need to hold a refcnt of it's child. When we > delete the parent, it will release the child refcnt, and it's child > obj will be > automatically deleted because the refcnt is decreased to 0. > The object_unref() release the refcnt hold by object_new(). I see. Thanks.