]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vfio/mdev: Avoid release parent reference during error path
authorParav Pandit <parav@mellanox.com>
Tue, 30 Apr 2019 22:49:28 +0000 (17:49 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit89079cc11af0510479ccd10bb3d688dd5f056817
treef195cf0201922d5221441950d44291d94e438f0b
parent3b6a8afbe4ccc405de862eaabb6d5a65346e320f
vfio/mdev: Avoid release parent reference during error path

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 60e7f2c3fe9919cee9534b422865eed49f4efb15 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/vfio/mdev/mdev_core.c