Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3560297pxb; Mon, 1 Mar 2021 13:21:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJz00PXsCKvokCEJpu+aoK+IRyl9oxzXWC+paJV2S0rWwUJ47GaBeUz6buIub2y9OdHjV23+ X-Received: by 2002:a17:906:ca58:: with SMTP id jx24mr17857305ejb.482.1614633705525; Mon, 01 Mar 2021 13:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614633705; cv=none; d=google.com; s=arc-20160816; b=sA/J/tnEGieiduwzSYXEIjB4MzmHjFUuVMQdwiHwoSkPzZO+ispqQ0rSW2G/qkgFun 9D0/0n4Jy1dzEi9eB8zZuoM8b++s2pub8BfUBKLZXmYt1Tiw9rWtFLdxa0IAWU/iEqnv oPZoV/l/Ooytszxd6++zSnn5eFcj1lRFRcBbWlq3UN/T9fU/6KsX8QrBE4OuMKZJspIy qZiVnq7MHYJ6qCcohoo7TnG/yuYPgRyEueU4yJt0hKba6OcraqH1pP4uq2qC+Zr935OJ LEjwIItCqbJcd8gvAr+DU2UA4c61TQaroPA2KWDkeAFjR7NGan8uQUWamVFdOwZLSa+A NFDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Gd3j9e5PRseqQ1lXL7Kv2YG7BFxJm1L0hCrev61UzhY=; b=q6NM7AmV93r0ub2CpAuUkH7WrZQDHHkc2yiBzWvSvBwET33d6GpWiQBdMmhT+sGcHo VQLM8kLUwbc6y8LRsHJtV/LhWtYBY9t4Wq6xLyAO7omPCzvkAY+CJKV2CVwPGqlC/aVl kIPEXMHu076X3WebJ5YJ7HoAlclg0V2etBeN1oS3qKw/6FDgP5mvNCPAp1BsssbUfmH2 PY1HLWRMFNnl7pHQB+iAKx6/8TpKJOERwzGfaIKZ4y2zxh8Tz6RIjo5s9YCP4Sw0TIX0 56a+/us9R6Pg+HaQbJ3ROPCMJlWsW8rtZB2++XuNEZyc0+7W6sHZNv2u9ldE8cY1M7RD d8cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eKo4U1SL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si11633247ejf.641.2021.03.01.13.21.23; Mon, 01 Mar 2021 13:21:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eKo4U1SL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244288AbhCAVSt (ORCPT + 99 others); Mon, 1 Mar 2021 16:18:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:50362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233298AbhCAROC (ORCPT ); Mon, 1 Mar 2021 12:14:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF7D66023C; Mon, 1 Mar 2021 16:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617129; bh=ylxZD6QphMt1uBf+IwusPVTKsT0T+1ZBe5Fvja7mWeI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKo4U1SL9bKQo8S50LDJv1l2BCRFv5tU2AzFeKTtksiPLFEJSC9K8k+C1ph5jAZSC yiZeXVAIaTvmMBCBn70pO0KnAiP+UFxGwqK7io/z3PYxd5P7maa/4SXdkBdVG3Kq5r oNmR7ZKveKH0Bp9WCsmcc07dTa2nrjFAKgny/QLk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Pavel Machek (CIP)" , Laurent Pinchart , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 4.19 212/247] media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt() Date: Mon, 1 Mar 2021 17:13:52 +0100 Message-Id: <20210301161042.046969617@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Machek commit 334de4b45892f7e67074e1b1b2ac36fd3e091118 upstream. Loop was useless as it would always exit on the first iteration. Fix it with right condition. Signed-off-by: Pavel Machek (CIP) Fixes: a86cf9b29e8b ("media: ipu3-cio2: Validate mbus format in setting subdev format") Tested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Cc: stable@vger.kernel.org # v4.16 and up Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1290,7 +1290,7 @@ static int cio2_subdev_set_fmt(struct v4 fmt->format.code = formats[0].mbus_code; for (i = 0; i < ARRAY_SIZE(formats); i++) { - if (formats[i].mbus_code == fmt->format.code) { + if (formats[i].mbus_code == mbus_code) { fmt->format.code = mbus_code; break; }