Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10494881pxu; Wed, 30 Dec 2020 04:27:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHoe0dd19Utq0Tc+hjXsLRe8B7a1E9pc+U5bL519rdf5zkmuA6oDRj0kLv0DiMOxUDsYUG X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr49405097edv.100.1609331255720; Wed, 30 Dec 2020 04:27:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609331255; cv=none; d=google.com; s=arc-20160816; b=sZv0INxrQMRLmJ8U2Eku9mSrwK9Bp75emE5rlc58L8o7Ty0MdwUUyRcQqHWalX7gPH MujLdW0fjCNrSIGc2hbblcMAtCM3tEOyw8nqKXY8rnn3vfXjmcehKMk4OpxvUbcn3vjh O3QZRfBIQYD8Uq7CJa8/zW6OGKVcUeOJDxv43TYoMgXE5Wb4K2fwif1e0ojMNn02OodH Uc1hTfuetpN40gyX0UGujgV6FjJ2vQpLCHTOM7vwH+3hfIs8EgpbeWvNEn9IF+iqOqiW peTDE65SqtQaYsf+yfkLr7cO2S9mAcNCwEkTNt4hMuj2ZtT1goPkbAdbZyjd9JqKer0r SxAg== 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=IvcnDZJKLPIqNFTcje1+YAEbxUNEj/bZjfVWqvuVHxM=; b=ehxi7AhvZg39sBLY8uILj4H7n3oqiq3yxS0We8q7tCW+UuDVJA5S3bkRpZzPDuIGyG i0tI7ErLRmhA97rYB95pgbZqTTSh6zM8ivAEaJc5qaSt/pcwQ8UI6N6XwKyti6G4g5QQ pk1tJATvDZOFWrKBUwIPhab/3AKIyq6UCE1UA8AEDuSyfvzHce3HyiDadSW5LoKgIdYN 1xTck5jzrLqcZvox8j3ZbvkUY9fYacciCXtvzzvqDbHYhMuNYmrwfpDG1aw8VYVT6Q9B P3m8GjkLRunT640H0qjvWW//z2uqpU4W1baWkWOZGvphXtHspfemvRX8yg95pOm4rwFG nB8A== 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 x22si21875066ejj.576.2020.12.30.04.27.13; Wed, 30 Dec 2020 04:27:35 -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 S1726627AbgL3M0F (ORCPT + 99 others); Wed, 30 Dec 2020 07:26:05 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:59260 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgL3M0E (ORCPT ); Wed, 30 Dec 2020 07:26:04 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 58B211C0B85; Wed, 30 Dec 2020 13:25:08 +0100 (CET) Date: Wed, 30 Dec 2020 13:25:08 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sakari Ailus , Andy Shevchenko , Laurent Pinchart , Mauro Carvalho Chehab Subject: Re: [PATCH 5.10 527/717] media: ipu3-cio2: Validate mbus format in setting subdev format Message-ID: <20201230122508.GA12190@duo.ucw.cz> References: <20201228125020.963311703@linuxfoundation.org> <20201228125046.214023397@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <20201228125046.214023397@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > commit a86cf9b29e8b12811cf53c4970eefe0c1d290476 upstream. >=20 > Validate media bus code, width and height when setting the subdev format. >=20 > This effectively reworks how setting subdev format is implemented in the > driver. Something is wrong here: > + fmt->format.code =3D formats[0].mbus_code; > + for (i =3D 0; i < ARRAY_SIZE(formats); i++) { > + if (formats[i].mbus_code =3D=3D fmt->format.code) { > + fmt->format.code =3D mbus_code; > + break; > + } This does not make sense. Loop will always exit during the first iteration, making the whole loop crazy/redundant. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX+xxpAAKCRAw5/Bqldv6 8mYzAKCETbl52Q18bQNCV0oKy68LnQVU0gCgod2H04ZTTtHa8oxWPzrYVvIyttQ= =H0EU -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--