From patchwork Mon Mar 1 12:02:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 71789 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1lGhH6-00ESgZ-Ga; Mon, 01 Mar 2021 12:03:45 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234959AbhCAMD1 (ORCPT + 1 other); Mon, 1 Mar 2021 07:03:27 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:49131 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233966AbhCAMD0 (ORCPT ); Mon, 1 Mar 2021 07:03:26 -0500 X-IronPort-AV: E=Sophos;i="5.81,215,1610377200"; d="scan'208";a="73495395" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 01 Mar 2021 21:02:16 +0900 Received: from localhost.localdomain (unknown [172.29.52.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 1464E40062A0; Mon, 1 Mar 2021 21:02:13 +0900 (JST) From: Biju Das To: Mauro Carvalho Chehab Cc: Biju Das , Laurent Pinchart , Kieran Bingham , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad Subject: [PATCH 1/2] media: v4l: vsp1: Fix bru null pointer access Date: Mon, 1 Mar 2021 12:02:07 +0000 Message-Id: <20210301120208.6707-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210301120208.6707-1-biju.das.jz@bp.renesas.com> References: <20210301120208.6707-1-biju.das.jz@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no RZ/G2L SoC has only BRS. This patch fixes null pointer access,when only BRS is enabled. Fixes: cbb7fa49c7466("media: v4l: vsp1: Rename BRU to BRx") Signed-off-by: Biju Das --- drivers/media/platform/vsp1/vsp1_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index 86d5e3f4b1ff..f6d2f47a4058 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -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; From patchwork Mon Mar 1 12:02:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 71790 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1lGhHF-00ESgZ-9V; Mon, 01 Mar 2021 12:03:53 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234349AbhCAMDv (ORCPT + 1 other); Mon, 1 Mar 2021 07:03:51 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:49131 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233966AbhCAMDr (ORCPT ); Mon, 1 Mar 2021 07:03:47 -0500 X-IronPort-AV: E=Sophos;i="5.81,215,1610377200"; d="scan'208";a="73495399" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 01 Mar 2021 21:02:19 +0900 Received: from localhost.localdomain (unknown [172.29.52.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id DF49340065CB; Mon, 1 Mar 2021 21:02:16 +0900 (JST) From: Biju Das To: Mauro Carvalho Chehab Cc: Biju Das , Laurent Pinchart , Kieran Bingham , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad Subject: [PATCH 2/2] media: v4l: vsp1: Fix uif null pointer access Date: Mon, 1 Mar 2021 12:02:08 +0000 Message-Id: <20210301120208.6707-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210301120208.6707-1-biju.das.jz@bp.renesas.com> References: <20210301120208.6707-1-biju.das.jz@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no RZ/G2L SoC has no UIF. This patch fixes null pointer access, when UIF module is not used. Fixes: 5e824f989e6e8("media: v4l: vsp1: Integrate DISCOM in display pipeline") Signed-off-by: Biju Das --- drivers/media/platform/vsp1/vsp1_drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index f6d2f47a4058..06f74d410973 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -462,9 +462,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1, * make sure it is present in the pipeline's list of entities if it * wasn't already. */ - if (!use_uif) { + if (drm_pipe->uif && !use_uif) { drm_pipe->uif->pipe = NULL; - } else if (!drm_pipe->uif->pipe) { + } else if (drm_pipe->uif && !drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe; list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); }