summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2015-07-11 19:46:11 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-08-10 15:11:12 +0300
commit37b617f9be527b1f1181e3ff23df4cdbe3e6441f (patch)
treede0c5122303af4ca1a73aed0f9ba594b287f6894 /drivers/video
parent9e6e35edb330619fbfa3457eff1d15d3672c833a (diff)
video: Fix possible leak in of_get_videomode()
In case videomode_from_timings() fails in function of_get_videomode(), the allocated display timing data is not freed in the exit path. Make sure that display_timings_release() is called in any case. Detected by Coverity CID 1309681. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/of_videomode.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c
index 111c2d1911d3..b5102aa6090d 100644
--- a/drivers/video/of_videomode.c
+++ b/drivers/video/of_videomode.c
@@ -44,11 +44,9 @@ int of_get_videomode(struct device_node *np, struct videomode *vm,
index = disp->native_mode;
ret = videomode_from_timings(disp, vm, index);
- if (ret)
- return ret;
display_timings_release(disp);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(of_get_videomode);