diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-09-18 15:51:30 +0530 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-10-04 10:06:01 +0900 |
commit | 53bd5556547d72fb9c572d66c3b7bfe0f096972b (patch) | |
tree | f1e190dc74fd584dc2466233643dc1f2ad40bd99 /drivers/gpu/drm/exynos/exynos_drm_connector.c | |
parent | 291257cf4cb0da1e32b672b88e73d22d845c8f93 (diff) |
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: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_connector.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_connector.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index 59e79ff4b2eb..87cf3783efdc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c @@ -150,8 +150,12 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) count = drm_add_edid_modes(connector, edid); kfree(edid); } else { - struct drm_display_mode *mode = drm_mode_create(connector->dev); 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) panel = display_ops->get_panel(manager->dev); |