summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Cruz <alfredo.carlon@gmail.com>2023-03-22 23:44:11 +0100
committerHeiko Stuebner <heiko@sntech.de>2023-03-23 00:18:58 +0100
commit4ab9157c7e02019fa8d8ab98d4f9e67e6a7cfad1 (patch)
tree13f03953116bec2b43f5cebbdccc7434f4e7d27c
parentb5af48eedcb53491c02ded55d5991e03d6da6dbf (diff)
drm/rockchip: vop2: Add error check to devm_regmap_init_mmiodrm-misc-next-2023-03-23
devm_regmap_init_mmio() may return an invalid pointer in case of an error. This patch adds the corresponding IS_ERR check to vop2->map. Signed-off-by: Alfredo Cruz <alfredo.carlon@gmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230322224411.15612-1-alfredo.carlon@gmail.com
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index fce992c3506f..38554ca2fc39 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -2679,6 +2679,8 @@ static int vop2_bind(struct device *dev, struct device *master, void *data)
vop2->len = resource_size(res);
vop2->map = devm_regmap_init_mmio(dev, vop2->regs, &vop2_regmap_config);
+ if (IS_ERR(vop2->map))
+ return PTR_ERR(vop2->map);
ret = vop2_win_init(vop2);
if (ret)