[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/msi: Don't dereference pdev before its NULL check



>>> On 23.07.15 at 12:54, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -1345,7 +1345,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
>      struct msi_desc *entry, *tmp;
>      struct irq_desc *desc;
>      struct msi_msg msg;
> -    u8 slot = PCI_SLOT(pdev->devfn), func = PCI_FUNC(pdev->devfn);
> +    u8 slot, func;
>      unsigned int type = 0, pos = 0;
>      u16 control = 0;
>  
> @@ -1357,6 +1357,9 @@ int pci_restore_msi_state(struct pci_dev *pdev)
>      if ( !pdev )
>          return -EINVAL;
>  
> +    slot = PCI_SLOT(pdev->devfn);
> +    func = PCI_FUNC(pdev->devfn);

I think this is the wrong way round - see the alternative patch just
sent.

Btw, how did you spot this so quickly now but not during review?
Any tool helping with that?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.