xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH] IOMMU: replace ASSERT()s checking for NULL
Date: Mon, 7 Nov 2016 10:30:37 +0000	[thread overview]
Message-ID: <cb1b1cfe-e278-18d7-de6c-c66e4a07c5bc@citrix.com> (raw)
In-Reply-To: <58205668020000780011C95E@prv-mh.provo.novell.com>

On 07/11/16 09:24, Jan Beulich wrote:
> Avoid NULL derefs on non-debug builds.
>
> Coverity ID: 1055650
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/drivers/passthrough/io.c
> +++ b/xen/drivers/passthrough/io.c
> @@ -165,7 +165,11 @@ static void pt_irq_time_out(void *data)
>      spin_lock(&irq_map->dom->event_lock);
>  
>      dpci = domain_get_irq_dpci(irq_map->dom);
> -    ASSERT(dpci);
> +    if ( unlikely(!dpci) )
> +    {
> +        ASSERT_UNREACHABLE();
> +        return;
> +    }
>      list_for_each_entry ( digl, &irq_map->digl_list, list )
>      {
>          unsigned int guest_gsi = hvm_pci_intx_gsi(digl->device, digl->intx);
> @@ -793,7 +797,11 @@ void hvm_dpci_msi_eoi(struct domain *d,
>  
>  static void hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci)
>  {
> -    ASSERT(d->arch.hvm_domain.irq.dpci);
> +    if ( unlikely(!d->arch.hvm_domain.irq.dpci) )
> +    {
> +        ASSERT_UNREACHABLE();
> +        return;
> +    }
>  
>      spin_lock(&d->event_lock);
>      if ( test_and_clear_bool(pirq_dpci->masked) )
>
>
>


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

  parent reply	other threads:[~2016-11-07 10:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07  9:24 [PATCH] IOMMU: replace ASSERT()s checking for NULL Jan Beulich
2016-11-07  9:53 ` Jan Beulich
2016-11-07 10:43   ` Andrew Cooper
2016-11-07 13:47     ` Jan Beulich
2016-11-07 10:30 ` Andrew Cooper [this message]
2016-11-07 10:41   ` Wei Liu
2016-11-07 14:43   ` Konrad Rzeszutek Wilk

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=cb1b1cfe-e278-18d7-de6c-c66e4a07c5bc@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).