]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: v4l: vsp1: Fix bru null pointer access
authorBiju Das <biju.das.jz@bp.renesas.com>
Mon, 1 Mar 2021 12:08:27 +0000 (13:08 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 11 Mar 2021 10:40:28 +0000 (11:40 +0100)
RZ/G2L SoC has only BRS. This patch fixes null pointer access,when only
BRS is enabled.

Fixes: 64bf807fc6d30("media: v4l: vsp1: Rename BRU to BRx")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/vsp1/vsp1_drm.c

index 86d5e3f4b1ffce357d57f29da4d50d080ccf4e22..f6d2f47a4058fa28ed82febbe3e5b51776090279 100644 (file)
@@ -245,7 +245,7 @@ static int vsp1_du_pipeline_setup_brx(struct vsp1_device *vsp1,
                brx = &vsp1->bru->entity;
        else if (pipe->brx && !drm_pipe->force_brx_release)
                brx = pipe->brx;
-       else if (!vsp1->bru->entity.pipe)
+       else if (vsp1_feature(vsp1, VSP1_HAS_BRU) && !vsp1->bru->entity.pipe)
                brx = &vsp1->bru->entity;
        else
                brx = &vsp1->brs->entity;