Skip to content

Commit b7b5a56

Browse files
committed
Merge tag 'exynos-drm-next-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
Two fixups - Fix a potential error pointer dereference by checking the return value of exynos_drm_crtc_get_by_type() function before accessing to crtc object. - Fix a wrong error checking in exynos_drm_dma.c modules, which was reported by Dan[1] [1] https://lore.kernel.org/all/[email protected]/ Signed-off-by: Dave Airlie <[email protected]> From: Inki Dae <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 9f3e1c5 + 8d1b780 commit b7b5a56

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/gpu/drm/exynos/exynos_drm_dma.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,16 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,
107107
return 0;
108108

109109
if (!priv->mapping) {
110-
void *mapping;
110+
void *mapping = NULL;
111111

112112
if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU))
113113
mapping = arm_iommu_create_mapping(&platform_bus_type,
114114
EXYNOS_DEV_ADDR_START, EXYNOS_DEV_ADDR_SIZE);
115115
else if (IS_ENABLED(CONFIG_IOMMU_DMA))
116116
mapping = iommu_get_domain_for_dev(priv->dma_dev);
117-
else
118-
mapping = ERR_PTR(-ENODEV);
119117

120-
if (IS_ERR(mapping))
121-
return PTR_ERR(mapping);
118+
if (!mapping)
119+
return -ENODEV;
122120
priv->mapping = mapping;
123121
}
124122

drivers/gpu/drm/exynos/exynos_hdmi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,8 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
18611861
return ret;
18621862

18631863
crtc = exynos_drm_crtc_get_by_type(drm_dev, EXYNOS_DISPLAY_TYPE_HDMI);
1864+
if (IS_ERR(crtc))
1865+
return PTR_ERR(crtc);
18641866
crtc->pipe_clk = &hdata->phy_clk;
18651867

18661868
ret = hdmi_create_connector(encoder);

0 commit comments

Comments
 (0)