From: Jingoo Han <jg1.han@samsung.com>
To: 'Tomasz Figa' <tomasz.figa@gmail.com>, 'Inki Dae' <inki.dae@samsung.com>
Cc: dri-devel@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org,
'Andrzej Hajda' <a.hajda@samsung.com>,
'Jingoo Han' <jg1.han@samsung.com>
Subject: Re: [PATCH] drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings
Date: Wed, 18 Jun 2014 10:07:48 +0900 [thread overview]
Message-ID: <004d01cf8a91$b8b849d0$2a28dd70$%han@samsung.com> (raw)
In-Reply-To: <1402433877-10867-1-git-send-email-tomasz.figa@gmail.com>
On Wednesday, June 11, 2014 5:58 AM, Tomasz Figa wrote:
>
> 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>
(+cc Inki Dae)
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Best regards,
Jingoo Han
> ---
> drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
> index f1b8587..f44bd90 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
> @@ -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;
> --
prev parent reply other threads:[~2014-06-18 1:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 20:57 [PATCH] drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings Tomasz Figa
2014-06-18 0:09 ` Tomasz Figa
2014-06-18 5:06 ` Inki Dae
2014-06-18 1:07 ` Jingoo Han [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='004d01cf8a91$b8b849d0$2a28dd70$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=tomasz.figa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox