All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/msi: Don't dereference pdev before its NULL check
Date: Thu, 23 Jul 2015 12:57:35 +0100	[thread overview]
Message-ID: <55B0D6AF.9060807@citrix.com> (raw)
In-Reply-To: <55B0EFF00200007800094871@prv-mh.provo.novell.com>

On 23/07/15 12:45, Jan Beulich wrote:
>>>> On 23.07.15 at 12:54, <andrew.cooper3@citrix.com> 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?

Ah - I accidentally neglected to say that it was Coverity.  It is hooked
automatically into all XenServer builds, and I am being proactive
keeping my upstream branch up-to-date, given the volume of code going in
at the moment.

~Andrew

      reply	other threads:[~2015-07-23 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 10:54 [PATCH] x86/msi: Don't dereference pdev before its NULL check Andrew Cooper
2015-07-23 11:45 ` Jan Beulich
2015-07-23 11:57   ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55B0D6AF.9060807@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.