mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
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>
This commit is contained in:
parent
9e6e35edb3
commit
37b617f9be
1 changed files with 1 additions and 3 deletions
|
@ -44,11 +44,9 @@ int of_get_videomode(struct device_node *np, struct videomode *vm,
|
||||||
index = disp->native_mode;
|
index = disp->native_mode;
|
||||||
|
|
||||||
ret = videomode_from_timings(disp, vm, index);
|
ret = videomode_from_timings(disp, vm, index);
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
display_timings_release(disp);
|
display_timings_release(disp);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(of_get_videomode);
|
EXPORT_SYMBOL_GPL(of_get_videomode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue