From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7N2x-0006xc-GB for qemu-devel@nongnu.org; Thu, 17 Nov 2016 08:48:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7N2s-0007wJ-Vv for qemu-devel@nongnu.org; Thu, 17 Nov 2016 08:48:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38334) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7N2s-0007w5-QU for qemu-devel@nongnu.org; Thu, 17 Nov 2016 08:48:06 -0500 From: Markus Armbruster References: <1479108340-3453-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1479108340-3453-3-git-send-email-caoj.fnst@cn.fujitsu.com> Date: Thu, 17 Nov 2016 14:48:03 +0100 In-Reply-To: <1479108340-3453-3-git-send-email-caoj.fnst@cn.fujitsu.com> (Cao jin's message of "Mon, 14 Nov 2016 15:25:32 +0800") Message-ID: <877f82gquk.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 02/10] hcd-xhci: check & correct param before using it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin Cc: qemu-devel@nongnu.org, Marcel Apfelbaum , "Michael S. Tsirkin" , Gerd Hoffmann Cao jin writes: > usb_xhci_realize() corrects invalid values of property "intrs" > automatically, but the uncorrected value is passed to msi_init(), > which chokes on invalid values. Delay that until after the > correction. > > Resources allocated by usb_xhci_init() are leaked when msi_init() > fails. Fix by calling it after msi_init(). > > CC: Gerd Hoffmann > CC: Markus Armbruster > CC: Marcel Apfelbaum > CC: Michael S. Tsirkin > Signed-off-by: Cao jin > --- > In previous rounds, usb_xhci_init() is moved too far from its original place, > which results the segfault(XHCIState->numports is initialized in this func), > now move it adjacent to msi_init code hunk. Thanks for explaining what you changed. Reviewed-by: Markus Armbruster