From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQHby-0000pU-Fo for qemu-devel@nongnu.org; Mon, 01 Feb 2016 11:45:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQHbr-0002HZ-G0 for qemu-devel@nongnu.org; Mon, 01 Feb 2016 11:45:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQHbr-0002HN-87 for qemu-devel@nongnu.org; Mon, 01 Feb 2016 11:45:51 -0500 From: Markus Armbruster References: <1450697444-30119-1-git-send-email-marcandre.lureau@redhat.com> <1450697444-30119-5-git-send-email-marcandre.lureau@redhat.com> <87egd075nn.fsf@blackfin.pond.sub.org> Date: Mon, 01 Feb 2016 17:45:47 +0100 In-Reply-To: (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Mon, 1 Feb 2016 14:59:54 +0100") Message-ID: <87zivkz8ec.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/8] libqos: remove some leaks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: QEMU Marc-Andr=C3=A9 Lureau writes: > Hi > > On Fri, Jan 29, 2016 at 4:43 PM, Markus Armbruster wr= ote: >> The existing users pass a func that saves dev, and free the saved dev >> later. Works as long as we call func() at most once. If multiple >> devices match, all but the last one are leaked. Can this happen? > > It is the responsability of the func() callback to deal with multiple > matches. If that's the case, and multiple devices can match, then the callbacks are all broken. > I don't think this needs to change. If you mean to say that you don't have to fix it in this series: yes, but it still needs fixing. If you don't want to fix it, consider adding a FIXME comment. > This fix is only about the case of unmatching devices that need to be > free within qpci_device_foreach(). > > Do you ack that fix? I'd be willing to.