diff mbox

ivshmem: remove redundant assignment, fix crash with msi=off

Message ID 1450696923-25723-1-git-send-email-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau Dec. 21, 2015, 11:22 a.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Fix crash when msi=false introduced in 660c97ee (msi_vectors is NULL in
this case)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/misc/ivshmem.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Prasad Pandit Dec. 21, 2015, 7:10 p.m. UTC | #1
+-- On Mon, 21 Dec 2015, marcandre.lureau@redhat.com wrote --+
| diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
| index 7d14222..dcfc8cc 100644
| --- a/hw/misc/ivshmem.c
| +++ b/hw/misc/ivshmem.c
| @@ -355,12 +355,9 @@ static CharDriverState* create_eventfd_chr_device(IVShmemState *s,
|                                                    int vector)
|  {
|      /* create a event character device based on the passed eventfd */
| -    PCIDevice *pdev = PCI_DEVICE(s);
|      int eventfd = event_notifier_get_fd(n);
|      CharDriverState *chr;
|  
| -    s->msi_vectors[vector].pdev = pdev;
| -
|      chr = qemu_chr_open_eventfd(eventfd);
|  
|      if (chr == NULL) {

Looks okay.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
Markus Armbruster Jan. 11, 2016, 3:07 p.m. UTC | #2
marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Fix crash when msi=false introduced in 660c97ee (msi_vectors is NULL in
> this case)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox

Patch

diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 7d14222..dcfc8cc 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -355,12 +355,9 @@  static CharDriverState* create_eventfd_chr_device(IVShmemState *s,
                                                   int vector)
 {
     /* create a event character device based on the passed eventfd */
-    PCIDevice *pdev = PCI_DEVICE(s);
     int eventfd = event_notifier_get_fd(n);
     CharDriverState *chr;
 
-    s->msi_vectors[vector].pdev = pdev;
-
     chr = qemu_chr_open_eventfd(eventfd);
 
     if (chr == NULL) {