diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-22 08:57:33 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-11-10 13:52:30 +0100 |
commit | a5d704d33245b0799947a3008f9f376dba4d5c91 (patch) | |
tree | 6c3b65b09942cda0425312ff2db997cd1acc3653 /drivers/gpu/drm/omapdrm/dss/dss.c | |
parent | drm: omapdrm: Replace HTTP links with HTTPS ones (diff) | |
download | linux-a5d704d33245b0799947a3008f9f376dba4d5c91.tar.xz linux-a5d704d33245b0799947a3008f9f376dba4d5c91.zip |
drm/omap: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter
even when it returns an error code. However, users of its
direct wrappers in omapdrm assume that PM usage counter will
not change on error. Thus a pairing decrement is needed on
the error handling path for these wrappers to keep the counter
balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200822065743.13671-1-dinghao.liu@zju.edu.cn
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/dss.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dss.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 6ccbc29c4ce4..d7b2f5bcac16 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -858,8 +858,11 @@ int dss_runtime_get(struct dss_device *dss) DSSDBG("dss_runtime_get\n"); r = pm_runtime_get_sync(&dss->pdev->dev); - WARN_ON(r < 0); - return r < 0 ? r : 0; + if (WARN_ON(r < 0)) { + pm_runtime_put_noidle(&dss->pdev->dev); + return r; + } + return 0; } void dss_runtime_put(struct dss_device *dss) |