Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1751544pxy; Thu, 29 Apr 2021 13:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2+pX5JNwyAP7kz85vpX2uRUsWCnByOwvvSW4Hn57WZiZL8w3QYDRe2VyGIA+v2XfkVrXa X-Received: by 2002:a17:906:c010:: with SMTP id e16mr438556ejz.214.1619729217610; Thu, 29 Apr 2021 13:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619729217; cv=none; d=google.com; s=arc-20160816; b=vPDygzeUuJei7MU/kK5biITzV8Ln72917Q30TMHHvZX4s4Xt7YO6REHnYHHL1szLX8 JyrOkrxIQYlC+T2z2jiT1+gBhQzc4IbXtYMD8Fip1trZCcoGXAPQihWEVQby5GjC9iJV k58h33w1VifwxbD2Pq7ZJVkL31rE15ufjTHpEegn8PMhRTxtcNd7ZtR/CN1mLH5Jdv9b 3a9U1iq7+SlABnpzYLX01fq/Pe400dN9XVPdEhgGRZFBWKFaSYqmCE9cc0qJGjBqAG+g 95iotAhfbE2HFp7obz80WwwU2FYc+ly/b6ZxhD/z8HwcHhsM+w+9F2ABCeybs+gcjtp4 Wu/A== 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=tBokGFZ6HNrsjsdxXY2eIuUm7RonCpzZOQ+N4CCQYIU=; b=VGXFhp9zg5EaujkrBTln5j0FqdCa0hUHJcVGQhUdddUbiN7E59lX9adVDI9BmeyxpE +TKfUTm8QjcbkzVCsgO7yuN83jH+gq5v1NEDjUeIgtKrWMr7uabUCvHTy87BphlQW9d4 0GrUWkt8DnxI3Ur+zLGXZTijBE5/mj/plclvjTnEAevge+VkTC5LERz2A5uiifO1Ph9B Uv3kp7EPUHiqEvLbIMc6r0Jl+HsK5WOsMl03jQp0GgAjqovh0SZ+CnIysjVeccMRQvFy ceOrWvFhKaQmhF+uewL0N9/px3BKLZ8k3uIq9UQCvvA8P/z1cuYPicOv8ArR6zlqcTor 3jdA== 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 gt9si1051887ejc.524.2021.04.29.13.46.33; Thu, 29 Apr 2021 13:46:57 -0700 (PDT) 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 S236889AbhD2US1 (ORCPT + 99 others); Thu, 29 Apr 2021 16:18:27 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:52954 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbhD2US1 (ORCPT ); Thu, 29 Apr 2021 16:18:27 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 516C01C0B9F; Thu, 29 Apr 2021 22:17:39 +0200 (CEST) Date: Thu, 29 Apr 2021 22:17:38 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Aditya Pakki , Hans Verkuil , Mauro Carvalho Chehab Subject: Re: [PATCH 057/190] Revert "media: saa7146: Avoid using BUG_ON as an assertion" Message-ID: <20210429201738.GG31692@amd> References: <20210421130105.1226686-1-gregkh@linuxfoundation.org> <20210421130105.1226686-58-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m972NQjnE83KvVa/" Content-Disposition: inline In-Reply-To: <20210421130105.1226686-58-gregkh@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --m972NQjnE83KvVa/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I doubt this is malicious, and BUG()s are ugly. I'd suggest keeping this. Best regards, Pavel > diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media= /common/saa7146/saa7146_video.c > index 7b8795eca589..d9d7d82ca451 100644 > --- a/drivers/media/common/saa7146/saa7146_video.c > +++ b/drivers/media/common/saa7146/saa7146_video.c > @@ -345,8 +345,7 @@ static int video_begin(struct saa7146_fh *fh) > =20 > fmt =3D saa7146_format_by_fourcc(dev, vv->video_fmt.pixelformat); > /* we need to have a valid format set here */ > - if (!fmt) > - return -EINVAL; > + BUG_ON(NULL =3D=3D fmt); > =20 > if (0 !=3D (fmt->flags & FORMAT_IS_PLANAR)) { > resource =3D RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS; > @@ -399,8 +398,7 @@ static int video_end(struct saa7146_fh *fh, struct fi= le *file) > =20 > fmt =3D saa7146_format_by_fourcc(dev, vv->video_fmt.pixelformat); > /* we need to have a valid format set here */ > - if (!fmt) > - return -EINVAL; > + BUG_ON(NULL =3D=3D fmt); > =20 > if (0 !=3D (fmt->flags & FORMAT_IS_PLANAR)) { > resource =3D RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS; --=20 http://www.livejournal.com/~pavelmachek --m972NQjnE83KvVa/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmCLFGIACgkQMOfwapXb+vJ5uACeOEbsMVKYsFGZKpafQHboGB7I kwAAn2QmGy6ehVV22bIkXDyY3r4IId4k =m03W -----END PGP SIGNATURE----- --m972NQjnE83KvVa/--