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 <borntrae...@de.ibm.com>

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

It is done.




Reply via email to