Received: by 10.192.165.148 with SMTP id m20csp2543895imm; Sun, 22 Apr 2018 09:13:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2tED+hhJ2VBbU8+TJWUdMmE9PdpOC2DvTyF//ZMa7T+0rSxdjvJ0eW/4yfTruPM6oRfmI X-Received: by 2002:a17:902:9886:: with SMTP id s6-v6mr17644508plp.380.1524413639381; Sun, 22 Apr 2018 09:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413639; cv=none; d=google.com; s=arc-20160816; b=XJVp1J/AClhaq6LV0ML8UVMPdScUSJ9c1Z1Q9r0WRjngmaorMS7RpP/zrvIVeZinkv CFi+RdthWb/mTFR16mttd00p8vQfiQNDTxbnREnkWShYywBuGC0gpRwL2wRV3wLWzkNb St+a0143Fok/Iobn8ztBQFH3IjIFrLks20jSvfR1rMFiOF/+DRysDeM3lp/NDKKwVFuJ 2HaYJiGkSzd0ZgWLWs9vuXCON+mTyu0KG9EK2zAlRpq0D/jzlBG5lb/tCK7iBzZt3MEx O+aq1bDMG6lYCcJ32UQXxgx+rEUsawgSeftrSYQkVjry879vaKuChdjwTuLvrsqGsxwI vj8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=r9nKFUQVhSGBcToAjREZVwHuy9rWfgurWXHUwPLhzuU=; b=uUInslpUmiLh2UlXH9c1A1y0ovrDhbwgXk7gHYicFjJQJCzLC01Rurh5oLr8lKdzwU Slzlw+cUq4wR5y8fFJYtshFt6lLjV4p6lS2QyigLJIT04kvzilmTD3GxIxD92edhU7dD zXNLzPbQsgy/9CBHgmsusqH7g1d8Ckj/ETqTRNsclcKB9LAirdymkcYjUWb2Ic3C+kBQ hs3rouHp8DrzpfpFgaWZSBkgSe/a0rZWt6b06oCrGABke53VHjfR4XWnUQQGQaLUNcYS RsS3e6AwJVLFL6sZstSLF+jZ1dF6MyEgNachuTsD4S03AqJIX+k2lylXoZkqd0UEDniO J9PA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9-v6si10293612pla.32.2018.04.22.09.13.45; Sun, 22 Apr 2018 09:13:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753638AbeDVNzz (ORCPT + 99 others); Sun, 22 Apr 2018 09:55:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44816 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753619AbeDVNzv (ORCPT ); Sun, 22 Apr 2018 09:55:51 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6AC5C9CE; Sun, 22 Apr 2018 13:55:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauro Carvalho Chehab , Kieran Bingham , Laurent Pinchart Subject: [PATCH 4.16 034/196] media: vsp1: Fix BRx conditional path in WPF Date: Sun, 22 Apr 2018 15:50:54 +0200 Message-Id: <20180422135105.866270090@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kieran Bingham commit 639fa43d59e5a41ca8c55592cd5c1021fea2ab83 upstream. When a BRx is provided by a pipeline, the WPF must determine the master layer. Currently the condition to check this identifies pipe->bru || pipe->num_inputs > 1. The code then moves on to dereference pipe->bru, thus the check fails static analysers on the possibility that pipe->num_inputs could be greater than 1 without pipe->bru being set. The reality is that the pipeline must have a BRx to support more than one input, thus this could never cause a fault - however it also identifies that the num_inputs > 1 check is redundant. Remove the redundant check - and always configure the master layer appropriately when we have a BRx configured in our pipeline. Fixes: 6134148f6098 ("v4l: vsp1: Add support for the BRS entity") Cc: stable@vger.kernel.org Suggested-by: Mauro Carvalho Chehab Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/vsp1/vsp1_wpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -452,7 +452,7 @@ static void wpf_configure(struct vsp1_en : VI6_WPF_SRCRPF_RPF_ACT_SUB(input->entity.index); } - if (pipe->bru || pipe->num_inputs > 1) + if (pipe->bru) srcrpf |= pipe->bru->type == VSP1_ENTITY_BRU ? VI6_WPF_SRCRPF_VIRACT_MST : VI6_WPF_SRCRPF_VIRACT2_MST;