]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/rockchip: vop: fix possible null-ptr-deref in vop_bind()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 22 Apr 2022 03:28:54 +0000 (11:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:59:21 +0000 (16:59 +0200)
commit6ff986e057bf28e2f7690dad410768b2270f9453
tree3c48802e5237917b94c2a64524bcb0aa522a2c07
parent0978fcce91b90b561b8c82e7c492ba9fc8440eef
drm/rockchip: vop: fix possible null-ptr-deref in vop_bind()

[ Upstream commit f8c242908ad15bbd604d3bcb54961b7d454c43f8 ]

It will cause null-ptr-deref in resource_size(), if platform_get_resource()
returns NULL, move calling resource_size() after devm_ioremap_resource() that
will check 'res' to avoid null-ptr-deref.

Fixes: 2048e3286f34 ("drm: rockchip: Add basic drm driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220422032854.2995175-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/rockchip/rockchip_drm_vop.c