* [PATCH] x86/MSI: drop bogus NULL check from pci_restore_msi_state()
@ 2015-07-23 11:44 Jan Beulich
2015-07-23 11:45 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2015-07-23 11:44 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
Commit 372900faf8 ("x86/MSI-X: reduce fiddling with control register
during restore") introduced de-references of pdev before it gets
checked against NULL. Instead of deferring the de-references, drop
the pointless check - both call sites do that check already.
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1354,9 +1354,6 @@ int pci_restore_msi_state(struct pci_dev
if ( !use_msi )
return -EOPNOTSUPP;
- if ( !pdev )
- return -EINVAL;
-
ret = xsm_resource_setup_pci(XSM_PRIV,
(pdev->seg << 16) | (pdev->bus << 8) |
pdev->devfn);
[-- Attachment #2: x86-MSI-restore-drop-pdev-check.patch --]
[-- Type: text/plain, Size: 822 bytes --]
x86/MSI: drop bogus NULL check from pci_restore_msi_state()
Commit 372900faf8 ("x86/MSI-X: reduce fiddling with control register
during restore") introduced de-references of pdev before it gets
checked against NULL. Instead of deferring the de-references, drop
the pointless check - both call sites do that check already.
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1354,9 +1354,6 @@ int pci_restore_msi_state(struct pci_dev
if ( !use_msi )
return -EOPNOTSUPP;
- if ( !pdev )
- return -EINVAL;
-
ret = xsm_resource_setup_pci(XSM_PRIV,
(pdev->seg << 16) | (pdev->bus << 8) |
pdev->devfn);
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/MSI: drop bogus NULL check from pci_restore_msi_state()
2015-07-23 11:44 [PATCH] x86/MSI: drop bogus NULL check from pci_restore_msi_state() Jan Beulich
@ 2015-07-23 11:45 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2015-07-23 11:45 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Keir Fraser
On 23/07/15 12:44, Jan Beulich wrote:
> Commit 372900faf8 ("x86/MSI-X: reduce fiddling with control register
> during restore") introduced de-references of pdev before it gets
> checked against NULL. Instead of deferring the de-references, drop
> the pointless check - both call sites do that check already.
>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
So they do.
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -1354,9 +1354,6 @@ int pci_restore_msi_state(struct pci_dev
> if ( !use_msi )
> return -EOPNOTSUPP;
>
> - if ( !pdev )
> - return -EINVAL;
> -
> ret = xsm_resource_setup_pci(XSM_PRIV,
> (pdev->seg << 16) | (pdev->bus << 8) |
> pdev->devfn);
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-23 11:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 11:44 [PATCH] x86/MSI: drop bogus NULL check from pci_restore_msi_state() Jan Beulich
2015-07-23 11:45 ` Andrew Cooper
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.