Sasha Levin
2020-Aug-21 16:18 UTC
[Nouveau] [PATCH AUTOSEL 4.14 25/30] drm/nouveau: Fix reference count leak in nouveau_connector_detect
From: Aditya Pakki <pakki001 at umn.edu> [ Upstream commit 990a1162986e8eff7ca18cc5a0e03b4304392ae2 ] nouveau_connector_detect() calls pm_runtime_get_sync and in turn increments the reference count. In case of failure, decrement the ref count before returning the error. Signed-off-by: Aditya Pakki <pakki001 at umn.edu> Signed-off-by: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 4a7d50a96d36f..b5c8219c54557 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -580,8 +580,10 @@ nouveau_connector_detect(struct drm_connector *connector, bool force) pm_runtime_get_noresume(dev->dev); } else { ret = pm_runtime_get_sync(dev->dev); - if (ret < 0 && ret != -EACCES) + if (ret < 0 && ret != -EACCES) { + pm_runtime_put_autosuspend(dev->dev); return conn_status; + } } nv_encoder = nouveau_connector_ddc_detect(connector); -- 2.25.1
Apparently Analagous Threads
- [PATCH AUTOSEL 5.8 50/62] drm/nouveau: Fix reference count leak in nouveau_connector_detect
- [PATCH AUTOSEL 5.7 49/61] drm/nouveau: Fix reference count leak in nouveau_connector_detect
- [PATCH AUTOSEL 5.4 38/48] drm/nouveau: Fix reference count leak in nouveau_connector_detect
- [PATCH AUTOSEL 4.19 32/38] drm/nouveau: Fix reference count leak in nouveau_connector_detect
- [PATCH AUTOSEL 4.9 21/26] drm/nouveau: Fix reference count leak in nouveau_connector_detect