From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSPu-0001Nx-Gx for qemu-devel@nongnu.org; Thu, 22 May 2014 08:48:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnSPl-0004Rf-GH for qemu-devel@nongnu.org; Thu, 22 May 2014 08:48:14 -0400 Sender: Paolo Bonzini Message-ID: <537DF1FF.3000101@redhat.com> Date: Thu, 22 May 2014 14:47:59 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1400758430-32697-1-git-send-email-saravanakumar.punith@gmail.com> In-Reply-To: <1400758430-32697-1-git-send-email-saravanakumar.punith@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci: move dereferencing of root only after verifying valid root pointer. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Saravanakumar , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, mst@redhat.com Il 22/05/2014 13:33, Saravanakumar ha scritto: > Move dereferencing of root only after verifying valid root pointer. > > > Signed-off-by: Saravanakumar > --- > hw/pci/pci.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 22fe5ee..8d6a8d4 100644 > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c > @@ -605,13 +605,13 @@ PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr) > int dom, bus; > unsigned slot; > > - assert(!root->parent_dev); > - > if (!root) { > fprintf(stderr, "No primary PCI bus\n"); > return NULL; > } > > + assert(!root->parent_dev); > + > if (!devaddr) { > *devfnp = -1; > return pci_find_bus_nr(root, 0); > Reviewed-by: Paolo Bonzini