Skip to content

Commit 73bf1c9

Browse files
Xiang Yangdaeinki
authored andcommitted
drm/exynos: fix a potential error pointer dereference
Smatch reports the warning below: drivers/gpu/drm/exynos/exynos_hdmi.c:1864 hdmi_bind() error: 'crtc' dereferencing possible ERR_PTR() The return value of exynos_drm_crtc_get_by_type maybe ERR_PTR(-ENODEV), which can not be used directly. Fix this by checking the return value before using it. Signed-off-by: Xiang Yang <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent 3392432 commit 73bf1c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)