Skip to content

Commit

Permalink
drm/nouveau/dispnv50: fix runtime pm imbalance on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dinghao Liu authored and Ben Skeggs committed May 22, 2020
1 parent d3faddc commit dc455f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/nouveau/dispnv50/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,10 @@ nv50_mstc_detect(struct drm_connector *connector,
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;
}

ret = drm_dp_mst_detect_port(connector, ctx, mstc->port->mgr,
mstc->port);
Expand Down

0 comments on commit dc455f4

Please sign in to comment.