Commit 53bd5556 authored by Sachin Kamat's avatar Sachin Kamat Committed by Inki Dae

drm/exynos: Fix potential NULL pointer dereference

drm_mode_create() returns NULL if it fails to create
a new display mode. Check the value returned to avoid NULL
pointer deferencing later.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent 291257cf
...@@ -150,8 +150,12 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) ...@@ -150,8 +150,12 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
count = drm_add_edid_modes(connector, edid); count = drm_add_edid_modes(connector, edid);
kfree(edid); kfree(edid);
} else { } else {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
struct exynos_drm_panel_info *panel; struct exynos_drm_panel_info *panel;
struct drm_display_mode *mode = drm_mode_create(connector->dev);
if (!mode) {
DRM_ERROR("failed to create a new display mode.\n");
return 0;
}
if (display_ops->get_panel) if (display_ops->get_panel)
panel = display_ops->get_panel(manager->dev); panel = display_ops->get_panel(manager->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment