diff options
author | Qinglang Miao <[email protected]> | 2020-12-01 20:56:31 +0800 |
---|---|---|
committer | Thierry Reding <[email protected]> | 2021-01-15 17:24:51 +0100 |
commit | dcdfe2712b68f1e9dbf4f1a96ad59b80e5cc0ef7 (patch) | |
tree | e0d0adf29d399170db19f54d8145169fdf83fb29 /drivers/gpu/drm/tegra/dsi.c | |
parent | 3ef170c25b974022b1ebec800e810fbc4b6fb06a (diff) |
drm/tegra: Fix reference leak when pm_runtime_get_sync() fails
The PM reference count is not expected to be incremented on return in
these Tegra functions.
However, pm_runtime_get_sync() will increment the PM reference count
even on failure. Forgetting to put the reference again will result in
a leak.
Replace it with pm_runtime_resume_and_get() to keep the usage counter
balanced.
Fixes: fd67e9c6ed5a ("drm/tegra: Do not implement runtime PM")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Qinglang Miao <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/tegra/dsi.c')
-rw-r--r-- | drivers/gpu/drm/tegra/dsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 5691ef1b0e58..f46d377f0c30 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -1111,7 +1111,7 @@ static int tegra_dsi_runtime_resume(struct host1x_client *client) struct device *dev = client->dev; int err; - err = pm_runtime_get_sync(dev); + err = pm_runtime_resume_and_get(dev); if (err < 0) { dev_err(dev, "failed to get runtime PM: %d\n", err); return err; |