]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/bridge: cdns: Fix PM reference leak in cdns_dsi_transfer()
authorZou Wei <zou_wei@huawei.com>
Mon, 24 May 2021 07:21:02 +0000 (15:21 +0800)
committerRobert Foss <robert.foss@linaro.org>
Thu, 27 May 2021 11:46:36 +0000 (13:46 +0200)
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
drivers/gpu/drm/bridge/cdns-dsi.c

index 76373e31df92dc444b82733b7b7c6730f27efade..b31281f76117c02335393fc9b447a6e166b2570b 100644 (file)
@@ -1028,7 +1028,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;