[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qemu-s390x] [Qemu-devel] [PATCH v10 5/6] s390x/vfio: ap: Introduce

From: Tony Krowiak
Subject: Re: [qemu-s390x] [Qemu-devel] [PATCH v10 5/6] s390x/vfio: ap: Introduce VFIO AP device
Date: Wed, 10 Oct 2018 10:20:28 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 10/10/2018 08:49 AM, Christian Borntraeger wrote:

On 10/10/2018 02:37 PM, Pierre Morel wrote:
On 09/10/2018 19:52, Tony Krowiak wrote:

+static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp)
+    GError *gerror;
+    char *symlink, *group_path;
+    int groupid;
+    symlink = g_strdup_printf("%s/iommu_group", vapdev->vdev.sysfsdev);
+    group_path = g_file_read_link(symlink, &gerror);

hum I oversaw this change, it leads to segfault.

Yes, this was a review feedback from v9 to use the glib function.

You must initialize gerror before use.
The following patch avoid a segmentation fault:

diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 5543406afc..3b8e9ba6dc 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -59,7 +59,7 @@ static void vfio_ap_put_device(VFIOAPDevice *vapdev)

  static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp)
-    GError *gerror;
+    GError *gerror = NULL;
      char *symlink, *group_path;
      int groupid;

With that fix, series
Tested-by: Christian Borntraeger <address@hidden>

Tony, can you fold that fixup from Pierre into your v11?

It is done.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]