summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorZou Wei <zou_wei@huawei.com>2021-05-24 15:21:02 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-19 08:53:09 +0200
commitc84e0757d80b097d73397fd8278ba8d96be7bfb9 (patch)
treec67c52f90f30a24b0b28583c131ea3b9820822bb /drivers/gpu/drm
parentcdfd4ceafba921d649b3a4c347cbc3f5c62e7a79 (diff)
downloadlinux-stable-c84e0757d80b097d73397fd8278ba8d96be7bfb9.tar.gz
linux-stable-c84e0757d80b097d73397fd8278ba8d96be7bfb9.tar.bz2
linux-stable-c84e0757d80b097d73397fd8278ba8d96be7bfb9.zip
drm/bridge: cdns: Fix PM reference leak in cdns_dsi_transfer()
[ Upstream commit 33f90f27e1c5ccd648d3e78a1c28be9ee8791cf1 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/1621840862-106024-1-git-send-email-zou_wei@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/bridge/cdns-dsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bridge/cdns-dsi.c b/drivers/gpu/drm/bridge/cdns-dsi.c
index 6166dca6be81..0cb9dd6986ec 100644
--- a/drivers/gpu/drm/bridge/cdns-dsi.c
+++ b/drivers/gpu/drm/bridge/cdns-dsi.c
@@ -1026,7 +1026,7 @@ static ssize_t cdns_dsi_transfer(struct mipi_dsi_host *host,
struct mipi_dsi_packet packet;
int ret, i, tx_len, rx_len;
- ret = pm_runtime_get_sync(host->dev);
+ ret = pm_runtime_resume_and_get(host->dev);
if (ret < 0)
return ret;