drm/rockchip: analogix_dp: Add missing error check for platform_get_resource()

Add missing error check for platform_get_resource() return value to
prevent NULL pointer dereference when memory resource is not available.

Fixes: 718b3bb9c0 ("drm/rockchip: analogix_dp: Expand device data to support multiple edp display")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260209033123.1089370-1-nichen@iscas.ac.cn
This commit is contained in:
Chen Ni 2026-02-09 11:31:23 +08:00 committed by Heiko Stuebner
parent 9fc0da8191
commit 45895f4d4d

View File

@ -461,6 +461,8 @@ static int rockchip_dp_probe(struct platform_device *pdev)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
i = 0;
while (dp_data[i].reg) {