Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-14 12:10:02 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-14 12:30:22 +0200
commit6b9fbbbeb8baa315053b6ab8a213969fdbc51d6e (patch)
treebb69cae63d01fe63b0d7c49ce1f3b4a7cc233ab6
parent2d003cbed85689351715ad1adcb6aadbb9a398af (diff)
vfio/mdev: Avoid release parent reference during error path
(bsc#1051510).
-rw-r--r--patches.fixes/vfio-mdev-Avoid-release-parent-reference-during-erro.patch40
-rw-r--r--series.conf1
2 files changed, 41 insertions, 0 deletions
diff --git a/patches.fixes/vfio-mdev-Avoid-release-parent-reference-during-erro.patch b/patches.fixes/vfio-mdev-Avoid-release-parent-reference-during-erro.patch
new file mode 100644
index 0000000000..f66cb88c0a
--- /dev/null
+++ b/patches.fixes/vfio-mdev-Avoid-release-parent-reference-during-erro.patch
@@ -0,0 +1,40 @@
+From 60e7f2c3fe9919cee9534b422865eed49f4efb15 Mon Sep 17 00:00:00 2001
+From: Parav Pandit <parav@mellanox.com>
+Date: Tue, 30 Apr 2019 17:49:28 -0500
+Subject: [PATCH] vfio/mdev: Avoid release parent reference during error path
+Git-commit: 60e7f2c3fe9919cee9534b422865eed49f4efb15
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+During mdev parent registration in mdev_register_device(),
+if parent device is duplicate, it releases the reference of existing
+parent device.
+This is incorrect. Existing parent device should not be touched.
+
+Fixes: 7b96953bc640 ("vfio: Mediated device Core driver")
+Reviewed-by: Cornelia Huck <cohuck@redhat.com>
+Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
+Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
+Signed-off-by: Parav Pandit <parav@mellanox.com>
+Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/vfio/mdev/mdev_core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
+index b96fedc77ee5..1299d2e72ce2 100644
+--- a/drivers/vfio/mdev/mdev_core.c
++++ b/drivers/vfio/mdev/mdev_core.c
+@@ -181,6 +181,7 @@ int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops)
+ /* Check for duplicate */
+ parent = __find_parent_device(dev);
+ if (parent) {
++ parent = NULL;
+ ret = -EEXIST;
+ goto add_dev_err;
+ }
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 7717e518e5..aa9a1989b5 100644
--- a/series.conf
+++ b/series.conf
@@ -21873,6 +21873,7 @@
patches.drivers/platform-x86-intel_punit_ipc-Revert-Fix-resource-ior.patch
patches.drivers/platform-x86-alienware-wmi-printing-the-wrong-error-.patch
patches.drivers/platform-x86-sony-laptop-Fix-unintentional-fall-thro.patch
+ patches.fixes/vfio-mdev-Avoid-release-parent-reference-during-erro.patch
patches.drivers/mtd-nand-omap-Fix-comment-in-platform-data-using-wro.patch
patches.fixes/0001-mtd-spi-nor-intel-spi-Avoid-crossing-4K-address-boun.patch
patches.drivers/mtd-part-fix-incorrect-format-specifier-for-an-unsig.patch