]> git.baikalelectronics.ru Git - kernel.git/commit
drm/tilcdc: fix leak & null ref in panel_connector_get_modes
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 29 Apr 2020 10:42:32 +0000 (13:42 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 19 May 2020 06:56:40 +0000 (09:56 +0300)
commit4e44090fb6ac162c8213c5098aabd2ec6122cc87
tree8d8e5e9068bbb59cb4e554bba86bd1eb62f68660
parent7e0d0652c7a8e8354767bc4258647edca7b5f5ab
drm/tilcdc: fix leak & null ref in panel_connector_get_modes

If videomode_from_timings() returns true, the mode allocated with
drm_mode_create will be leaked.

Also, the return value of drm_mode_create() is never checked, and thus
could cause NULL deref.

Fix these two issues.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429104234.18910-1-tomi.valkeinen@ti.com
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
drivers/gpu/drm/tilcdc/tilcdc_panel.c