aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-05-20 18:47:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:18:04 +0200
commit482466b67d87ccd4b9a1d9569d5086d68a7fee7d (patch)
treee9b55405e0b3a627142849ef3ba02d8e511c752c
parentbd39447bad06e9623ce75f3edb3c96f9b00862b1 (diff)
downloadlinux-stable-482466b67d87ccd4b9a1d9569d5086d68a7fee7d.tar.gz
drm/nouveau/dispnv50: fix runtime pm imbalance on error
[ Upstream commit dc455f4c888365595c0a13da445e092422d55b8d ] pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/disp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 419a02260bfa75..ee2b1e1199e093 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1032,8 +1032,10 @@ nv50_mstc_detect(struct drm_connector *connector, bool force)
return connector_status_disconnected;
ret = pm_runtime_get_sync(connector->dev->dev);
- if (ret < 0 && ret != -EACCES)
+ if (ret < 0 && ret != -EACCES) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
conn_status = drm_dp_mst_detect_port(connector, mstc->port->mgr,
mstc->port);