Skip to content

Commit

Permalink
video: Fix possible leak in of_get_videomode()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Engelmayer authored and Tomi Valkeinen committed Aug 10, 2015
1 parent 9e6e35e commit 37b617f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/video/of_videomode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 37b617f

Please sign in to comment.