* [PATCH] drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings
@ 2014-06-10 20:57 Tomasz Figa
2014-06-18 0:09 ` Tomasz Figa
2014-06-18 1:07 ` Jingoo Han
0 siblings, 2 replies; 4+ messages in thread
From: Tomasz Figa @ 2014-06-10 20:57 UTC (permalink / raw)
To: dri-devel; +Cc: linux-samsung-soc, Andrzej Hajda
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>
---
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;
--
2.0.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings
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
1 sibling, 1 reply; 4+ messages in thread
From: Tomasz Figa @ 2014-06-18 0:09 UTC (permalink / raw)
To: dri-devel; +Cc: linux-samsung-soc, Andrzej Hajda
On 10.06.2014 22:57, 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>
> ---
> 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;
>
Ping.
Best regards,
Tomasz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings
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 1:07 ` Jingoo Han
1 sibling, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2014-06-18 1:07 UTC (permalink / raw)
To: 'Tomasz Figa', 'Inki Dae'
Cc: dri-devel, linux-samsung-soc, 'Andrzej Hajda',
'Jingoo Han'
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;
> --
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/exynos: dpi: Fix NULL pointer dereference with legacy bindings
2014-06-18 0:09 ` Tomasz Figa
@ 2014-06-18 5:06 ` Inki Dae
0 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2014-06-18 5:06 UTC (permalink / raw)
To: Tomasz Figa; +Cc: dri-devel, linux-samsung-soc, David Airlie, Andrzej Hajda
On 2014년 06월 18일 09:09, Tomasz Figa wrote:
> On 10.06.2014 22:57, 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>
>> ---
>> 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;
>>
>
> Ping.
Applied.
Thanks,
Inki Dae
>
> Best regards,
> Tomasz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-18 5:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).