All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/exynos: iommu: fix potential NULL pointer dereference
@ 2015-06-25 13:10 Marek Szyprowski
  2015-06-29  6:35 ` Hyungwon Hwang
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Szyprowski @ 2015-06-25 13:10 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel
  Cc: Krzysztof Kozlowski, Andrzej Hajda, Gustavo Padovan, Marek Szyprowski

Some drivers (like Exynos mixer) calls drm_iommu_attach_device_if_possible
before registering crtc, so additional check for NULL crtc pointer is
required.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
index d4ec7465e9cc..d4eb730ba254 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
@@ -151,7 +151,7 @@ int drm_iommu_attach_device_if_possible(struct exynos_drm_crtc *exynos_crtc,
 	int ret = 0;
 
 	if (is_drm_iommu_supported(drm_dev)) {
-		if (exynos_crtc->ops->clear_channels)
+		if (exynos_crtc && exynos_crtc->ops->clear_channels)
 			exynos_crtc->ops->clear_channels(exynos_crtc);
 		return drm_iommu_attach_device(drm_dev, subdrv_dev);
 	}
-- 
1.9.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/exynos: iommu: fix potential NULL pointer dereference
  2015-06-25 13:10 [PATCH] drm/exynos: iommu: fix potential NULL pointer dereference Marek Szyprowski
@ 2015-06-29  6:35 ` Hyungwon Hwang
  2015-07-02 12:46   ` Joonyoung Shim
  0 siblings, 1 reply; 3+ messages in thread
From: Hyungwon Hwang @ 2015-06-29  6:35 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Krzysztof Kozlowski, linux-samsung-soc, dri-devel, Andrzej Hajda,
	Gustavo Padovan

Dear Marek,

On Thu, 25 Jun 2015 15:10:12 +0200
Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> Some drivers (like Exynos mixer) calls
> drm_iommu_attach_device_if_possible before registering crtc, so
> additional check for NULL crtc pointer is required.

It seems reasonable.

Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com>

> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
> b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index
> d4ec7465e9cc..d4eb730ba254 100644 ---
> a/drivers/gpu/drm/exynos/exynos_drm_iommu.c +++
> b/drivers/gpu/drm/exynos/exynos_drm_iommu.c @@ -151,7 +151,7 @@ int
> drm_iommu_attach_device_if_possible(struct exynos_drm_crtc
> *exynos_crtc, int ret = 0; 
>  	if (is_drm_iommu_supported(drm_dev)) {
> -		if (exynos_crtc->ops->clear_channels)
> +		if (exynos_crtc && exynos_crtc->ops->clear_channels)
>  			exynos_crtc->ops->clear_channels(exynos_crtc);
>  		return drm_iommu_attach_device(drm_dev, subdrv_dev);
>  	}

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/exynos: iommu: fix potential NULL pointer dereference
  2015-06-29  6:35 ` Hyungwon Hwang
@ 2015-07-02 12:46   ` Joonyoung Shim
  0 siblings, 0 replies; 3+ messages in thread
From: Joonyoung Shim @ 2015-07-02 12:46 UTC (permalink / raw)
  To: Hyungwon Hwang, Marek Szyprowski
  Cc: Krzysztof Kozlowski, linux-samsung-soc, dri-devel, Andrzej Hajda,
	Gustavo Padovan

On 06/29/2015 03:35 PM, Hyungwon Hwang wrote:
> Dear Marek,
> 
> On Thu, 25 Jun 2015 15:10:12 +0200
> Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> 
>> Some drivers (like Exynos mixer) calls
>> drm_iommu_attach_device_if_possible before registering crtc, so
>> additional check for NULL crtc pointer is required.
> 
> It seems reasonable.
> 
> Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com>
> 

This patch is ok but i think it can remove to use clear_channels
function pointer and drm_iommu_attach_device_if_possible function
because already drm_iommu_attach_device function checks whether support
iommu internally.

I will ready related patch.

Thanks.

>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_iommu.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
>> b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index
>> d4ec7465e9cc..d4eb730ba254 100644 ---
>> a/drivers/gpu/drm/exynos/exynos_drm_iommu.c +++
>> b/drivers/gpu/drm/exynos/exynos_drm_iommu.c @@ -151,7 +151,7 @@ int
>> drm_iommu_attach_device_if_possible(struct exynos_drm_crtc
>> *exynos_crtc, int ret = 0; 
>>  	if (is_drm_iommu_supported(drm_dev)) {
>> -		if (exynos_crtc->ops->clear_channels)
>> +		if (exynos_crtc && exynos_crtc->ops->clear_channels)
>>  			exynos_crtc->ops->clear_channels(exynos_crtc);
>>  		return drm_iommu_attach_device(drm_dev, subdrv_dev);
>>  	}
> 
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-02 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 13:10 [PATCH] drm/exynos: iommu: fix potential NULL pointer dereference Marek Szyprowski
2015-06-29  6:35 ` Hyungwon Hwang
2015-07-02 12:46   ` Joonyoung Shim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.