[PATCH] drm/exynos: iommu: fix potential NULL pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux