Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10511109pxu; Wed, 30 Dec 2020 04:59:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+Wkw968qDDrTCfRU0OHllrKqq60um3yH1rjk+U0UQzPfCRLpKIgyKOEDXNbL4khxaPq0W X-Received: by 2002:a17:906:2ccb:: with SMTP id r11mr27870254ejr.39.1609333150829; Wed, 30 Dec 2020 04:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609333150; cv=none; d=google.com; s=arc-20160816; b=sf0ti9DC/MYFitYE31vzpdvzNSNqrEmFH/Q5vuarXL/CwhDetvv4xuwKvzJWQY0qyH aZhji+sqRRASMBMGB8tp2zqJLPC5WGa6rZGX+lBks6zFxO1RKAyeDwvsFr5Ny8c5QSjB uPoZfC5QXeJnwAEBHh7yXps7e0HN7D1bCrIUUnKo6G3pheJoQjJ1zaecfaxzo/98r/2/ YVSD5//Cde171D9uzZEFzjcHgbcaQG/WeJK4VhZy10nkQnna4poeTTELFYXwYxG2Q/2E u7y1MQoJRZ9DLJ8PFkCqG72T66zOU6Y4NsWJ05pgFOM2zPwUg5O+yOw/avt8SQGYT2PK TQ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VCwdF1rfak2bYMjMWVDz7mmdfqcj9vPf8WurlSrIP6s=; b=gyAtSosheweD0tnzjwmiIOKeGL2zAOjcl4EH6lKBmNGAElM6Cy/E3DlF84FEbkLSkn FBnV8hiW4wdSySZHEtzFOoetc4GcPOiTzNkGVIv+e/LWUbKWIoKxwp7DXPmulIDQSFqS AETGCLHV9zshz0T/nW01i/2vNVPu67MqmMPlO/0SusTOiyiKF3bZ9uVTs3SjJxEkkzhB SCK/c78I8UlLvSTD9G4OykOMqRIlVsfgnPOM8QJ/vUk6P4QjnvX569Um+YGS+K2wIgB1 /r0JsEuGCx96mp6CYqUFaULebc0aWH+rSk8LkWFj91gftB6katQWVFbTib/9NiJUE8HR OHAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si23838163eda.110.2020.12.30.04.58.48; Wed, 30 Dec 2020 04:59:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgL3M51 (ORCPT + 99 others); Wed, 30 Dec 2020 07:57:27 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:33850 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgL3M51 (ORCPT ); Wed, 30 Dec 2020 07:57:27 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 499FB1C0B78; Wed, 30 Dec 2020 13:56:29 +0100 (CET) Date: Wed, 30 Dec 2020 13:56:28 +0100 From: Pavel Machek To: Laurent Pinchart Cc: Andy Shevchenko , Pavel Machek , Greg Kroah-Hartman , Linux Kernel Mailing List , Stable , Sakari Ailus , Mauro Carvalho Chehab Subject: Re: [PATCH 5.10 527/717] media: ipu3-cio2: Validate mbus format in setting subdev format Message-ID: <20201230125628.GB13161@duo.ucw.cz> References: <20201228125020.963311703@linuxfoundation.org> <20201228125046.214023397@linuxfoundation.org> <20201230122508.GA12190@duo.ucw.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2020-12-30 14:44:41, Laurent Pinchart wrote: > On Wed, Dec 30, 2020 at 02:32:46PM +0200, Andy Shevchenko wrote: > > On Wed, Dec 30, 2020 at 2:25 PM Pavel Machek wrote: > >=20 > > > > commit a86cf9b29e8b12811cf53c4970eefe0c1d290476 upstream. > > > > > > > > Validate media bus code, width and height when setting the subdev f= ormat. > > > > > > > > This effectively reworks how setting subdev format is implemented i= n the > > > > driver. > > > > > > Something is wrong here: > > > > > > > + fmt->format.code =3D formats[0].mbus_code; > > > > + for (i =3D 0; i < ARRAY_SIZE(formats); i++) { > >=20 > > Looks like 'i =3D 1' should be... > >=20 > > > > + if (formats[i].mbus_code =3D=3D fmt->format.code) { >=20 > More likely >=20 > if (formats[i].mbus_code =3D=3D mbus_code) { >=20 > I think. That looks reasonable, but I don't have hardware to test. > Pavel, would you like to submit a patch ? Done, should be in your inbox. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX+x4/AAKCRAw5/Bqldv6 8ut1AKCeguNK4/d1qTU2rUmE6uQxl7TiiACfaiFUMA/wZpA/nrNhCbhoVqVnUr8= =9SGb -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes--