From: Max Gurtovoy Date: Tue, 18 May 2021 19:21:31 +0000 (+0300) Subject: vfio/platform: fix module_put call in error flow X-Git-Tag: v5.10.43~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46ae882bb19a12e8df9936e8dcf1924b6abb2b56;p=thirdparty%2Fkernel%2Fstable.git vfio/platform: fix module_put call in error flow [ Upstream commit dc51ff91cf2d1e9a2d941da483602f71d4a51472 ] The ->parent_module is the one that use in try_module_get. It should also be the one the we use in module_put during vfio_platform_open(). Fixes: 32a2d71c4e80 ("vfio: platform: introduce vfio-platform-base module") Signed-off-by: Max Gurtovoy Message-Id: <20210518192133.59195-1-mgurtovoy@nvidia.com> Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c index fb4b385191f28..e83a7cd15c956 100644 --- a/drivers/vfio/platform/vfio_platform_common.c +++ b/drivers/vfio/platform/vfio_platform_common.c @@ -289,7 +289,7 @@ err_irq: vfio_platform_regions_cleanup(vdev); err_reg: mutex_unlock(&driver_lock); - module_put(THIS_MODULE); + module_put(vdev->parent_module); return ret; }