From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyepr-0001HD-Jq for qemu-devel@nongnu.org; Tue, 17 Nov 2015 06:54:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyepo-0003ne-Dp for qemu-devel@nongnu.org; Tue, 17 Nov 2015 06:54:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyepo-0003na-8E for qemu-devel@nongnu.org; Tue, 17 Nov 2015 06:54:04 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BD8FDA8C for ; Tue, 17 Nov 2015 11:54:03 +0000 (UTC) Message-ID: <1447761241.23726.68.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 17 Nov 2015 12:54:01 +0100 In-Reply-To: <1447718794-19812-2-git-send-email-bsd@redhat.com> References: <1447718794-19812-1-git-send-email-bsd@redhat.com> <1447718794-19812-2-git-send-email-bsd@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/4] usb-mtp: use a list for keeping track of children List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bandan Das Cc: qemu-devel@nongnu.org Hi, > + QLIST_FOREACH(iter, &o->children, list) { > + usb_mtp_object_free(s, iter); You have to use QLIST_FOREACH_SAFE here to avoid use-after-free on iter. Or, as you free the whole list anyway, just grab QLIST_FIRST() while ! QLIST_EMPTY(). cheers, Gerd