Skip to content

Commit

Permalink
drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings
Browse files Browse the repository at this point in the history
If there is no panel node in DT and instead display timings are provided
directly in FIMD node, there is no panel object created and ctx->panel
becomes NULL. However during Exynos DRM initialization
drm_helper_hpd_irq_event() is called, which in turns calls
exynos_dpi_detect(), which dereferences ctx->panel without a check,
causing a NULL pointer derefrence.

This patch fixes the issue by adding necessary NULL pointer check.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Tomasz Figa authored and Inki Dae committed Jun 24, 2014
1 parent 245f98f commit aaa51b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exynos_dpi_detect(struct drm_connector *connector, bool force)
{
struct exynos_dpi *ctx = connector_to_dpi(connector);

if (!ctx->panel->connector)
if (ctx->panel && !ctx->panel->connector)
drm_panel_attach(ctx->panel, &ctx->connector);

return connector_status_connected;
Expand Down

0 comments on commit aaa51b1

Please sign in to comment.