Skip to content

Commit

Permalink
drm/nouveau: Fix reference count leak in nouveau_connector_detect
Browse files Browse the repository at this point in the history
[ Upstream commit 990a116 ]

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@umn.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Aditya Pakki authored and gregkh committed Sep 3, 2020
1 parent 62f9a87 commit e95673a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_connector.c
Expand Up @@ -572,8 +572,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);
Expand Down

0 comments on commit e95673a

Please sign in to comment.