summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/omap2/omapfb/dss/venc.c
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2020-06-13 22:05:18 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2020-07-10 16:17:25 +0200
commit78c2ce9bde70be5be7e3615a2ae7024ed8173087 (patch)
treed8358080fdbe511ddf2a430d384f6bcfe22173db /drivers/video/fbdev/omap2/omapfb/dss/venc.c
parentedcb3895a751c762a18d25c8d9846ce9759ed7e1 (diff)
downloadlinux-78c2ce9bde70be5be7e3615a2ae7024ed8173087.tar.bz2
omapfb: fix multiple reference count leaks due to pm_runtime_get_sync
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Cc: kjlu@umn.edu Cc: wu000273@umn.edu Cc: Allison Randal <allison@lohutok.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Enrico Weigelt <info@metux.net> cc: "Andrew F. Davis" <afd@ti.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Alexios Zavras <alexios.zavras@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200614030528.128064-1-pakki001@umn.edu
Diffstat (limited to 'drivers/video/fbdev/omap2/omapfb/dss/venc.c')
-rw-r--r--drivers/video/fbdev/omap2/omapfb/dss/venc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
index d5404d56c922..0b0ad20afd63 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
@@ -348,8 +348,11 @@ static int venc_runtime_get(void)
DSSDBG("venc_runtime_get\n");
r = pm_runtime_get_sync(&venc.pdev->dev);
- WARN_ON(r < 0);
- return r < 0 ? r : 0;
+ if (WARN_ON(r < 0)) {
+ pm_runtime_put_sync(&venc.pdev->dev);
+ return r;
+ }
+ return 0;
}
static void venc_runtime_put(void)