Skip to content

Commit e95673a

Browse files
Aditya Pakkigregkh
authored andcommitted
drm/nouveau: Fix reference count leak in nouveau_connector_detect
[ 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>
1 parent 62f9a87 commit e95673a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/gpu/drm/nouveau/nouveau_connector.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,10 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
572572
pm_runtime_get_noresume(dev->dev);
573573
} else {
574574
ret = pm_runtime_get_sync(dev->dev);
575-
if (ret < 0 && ret != -EACCES)
575+
if (ret < 0 && ret != -EACCES) {
576+
pm_runtime_put_autosuspend(dev->dev);
576577
return conn_status;
578+
}
577579
}
578580

579581
nv_encoder = nouveau_connector_ddc_detect(connector);

0 commit comments

Comments
 (0)