Patch "vfio: platform: fix reference leak in vfio_platform_open" has been added to the 5.9-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    vfio: platform: fix reference leak in vfio_platform_open

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     vfio-platform-fix-reference-leak-in-vfio_platform_op.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2af31f1f7bb567420a7709c52b68a04af4022843
Author: Zhang Qilong <zhangqilong3@xxxxxxxxxx>
Date:   Sat Oct 31 11:03:53 2020 +0800

    vfio: platform: fix reference leak in vfio_platform_open
    
    [ Upstream commit bb742ad01961a3b9d1f9d19375487b879668b6b2 ]
    
    pm_runtime_get_sync() will increment pm usage counter even it
    failed. Forgetting to call pm_runtime_put will result in
    reference leak in vfio_platform_open, so we should fix it.
    
    Signed-off-by: Zhang Qilong <zhangqilong3@xxxxxxxxxx>
    Acked-by: Eric Auger <eric.auger@xxxxxxxxxx>
    Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index c0771a9567fb5..fb4b385191f28 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -267,7 +267,7 @@ static int vfio_platform_open(void *device_data)
 
 		ret = pm_runtime_get_sync(vdev->device);
 		if (ret < 0)
-			goto err_pm;
+			goto err_rst;
 
 		ret = vfio_platform_call_reset(vdev, &extra_dbg);
 		if (ret && vdev->reset_required) {
@@ -284,7 +284,6 @@ static int vfio_platform_open(void *device_data)
 
 err_rst:
 	pm_runtime_put(vdev->device);
-err_pm:
 	vfio_platform_irq_cleanup(vdev);
 err_irq:
 	vfio_platform_regions_cleanup(vdev);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux