drm/exynos: fix a potential error pointer dereference
authorXiang Yang <xiangyang3@huawei.com>
Sat, 12 Aug 2023 06:27:48 +0000 (14:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:51:42 +0000 (11:51 +0100)
commit2debe511c1d28dfc73e2e352de70fdec9a503833
tree9cd0db70d3beff4dd6887c0c84a163fa54a15738
parentfb26de4a86e19711880e7e845505505f01d2eb82
drm/exynos: fix a potential error pointer dereference

[ Upstream commit 73bf1c9ae6c054c53b8e84452c5e46f86dd28246 ]

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 <xiangyang3@huawei.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/exynos/exynos_hdmi.c