提交 e6559e91 编写于 作者: M Max Gurtovoy 提交者: Yang Yingliang

vfio/platform: fix module_put call in error flow

[ Upstream commit dc51ff91 ]

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: 32a2d71c ("vfio: platform: introduce vfio-platform-base module")
Signed-off-by: NMax Gurtovoy <mgurtovoy@nvidia.com>
Message-Id: <20210518192133.59195-1-mgurtovoy@nvidia.com>
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4de41a5c
...@@ -295,7 +295,7 @@ static int vfio_platform_open(void *device_data) ...@@ -295,7 +295,7 @@ static int vfio_platform_open(void *device_data)
vfio_platform_regions_cleanup(vdev); vfio_platform_regions_cleanup(vdev);
err_reg: err_reg:
mutex_unlock(&driver_lock); mutex_unlock(&driver_lock);
module_put(THIS_MODULE); module_put(vdev->parent_module);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册