All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: arei.gonglei@huawei.com
Cc: weidong.huangwei@huawei.com, pbonzini@redhat.com,
	alex.williamson@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] pci-assign: Fix a bug when map MSI-X table memory failed
Date: Wed, 9 Apr 2014 17:21:29 +0300	[thread overview]
Message-ID: <20140409142129.GA13764@redhat.com> (raw)
In-Reply-To: <1396502304-7456-1-git-send-email-arei.gonglei@huawei.com>

On Thu, Apr 03, 2014 at 01:18:23PM +0800, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
> 
> when map MSI-X table memory failed, the dev->msix_table not be
> set to NULL, the assigned_dev_unregister_msix_mmio() will case
> a segfault when munmap the failed dev->msix_table.
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>


Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/i386/kvm/pci-assign.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index a825871..570333f 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1608,6 +1608,7 @@ static int assigned_dev_register_msix_mmio(AssignedDevice *dev)
>                             MAP_ANONYMOUS|MAP_PRIVATE, 0, 0);
>      if (dev->msix_table == MAP_FAILED) {
>          error_report("fail allocate msix_table! %s", strerror(errno));
> +        dev->msix_table = NULL;
>          return -EFAULT;
>      }
>  
> -- 
> 1.7.12.4
> 

      parent reply	other threads:[~2014-04-09 14:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03  5:18 [Qemu-devel] [PATCH 1/2] pci-assign: Fix a bug when map MSI-X table memory failed arei.gonglei
2014-04-03  5:18 ` [Qemu-devel] [PATCH 2/2] pci-assign: Fix memory out of bound when MSI-X table not fit in a single page arei.gonglei
2014-04-08 15:32   ` Michael S. Tsirkin
2014-04-09 10:56     ` Gonglei (Arei)
2014-04-09 13:52       ` Michael S. Tsirkin
2014-04-10  2:34         ` Gonglei (Arei)
2014-04-09 14:12   ` Laszlo Ersek
2014-04-10  2:05     ` Gonglei (Arei)
2014-04-08 14:02 ` [Qemu-devel] [PATCH 1/2] pci-assign: Fix a bug when map MSI-X table memory failed Gonglei (Arei)
2014-04-08 15:32 ` Michael S. Tsirkin
2014-04-09 14:21 ` Michael S. Tsirkin [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=20140409142129.GA13764@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weidong.huangwei@huawei.com \
    /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.