Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8312174ybi; Thu, 6 Jun 2019 10:04:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxFBXxDXn7/9TCvk9juAj6lL1Iaqc7oM+7Kk1Mxr6oQw5CkSLco89V2heVqlR44Y30f2+6 X-Received: by 2002:a17:902:67:: with SMTP id 94mr52066150pla.64.1559840663500; Thu, 06 Jun 2019 10:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559840663; cv=none; d=google.com; s=arc-20160816; b=ptm6kbqrA1yuKsvWmApsWZXa19svpCX4w3dy9iQ50Svk6OexFF9PYMJzGU63NTUXEK 3HOY74TBI0DYEhnoVik8YxV5UB3KLFTrw39buVl2L4gjlCOeltHHzcYJvJqFCYAMQSVe uJ3dBWZK9xwOycY+6QQ2RoaTT9zc3eibBhOXaXmHiB4JH/Au9oFrFcqL11ljPUOj9zZD 8iQ2+gYMMcfxYcUAH4FHxR50yEYj+u1nEngFhyGE2fF23SYmxSF+RovkUPP4n5yO6nYl 18rJ+U/tryAnunIfEN3znauiYqX6QvqPReoqzCz+BIDPavO8qLhKnGWP/+yrLS9JK4Wt OHUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1aJ+6Vi/p81tmfjZYPmZ3XZco/paqTKjEbqaSOL6xhw=; b=zuducCaDpERHOTUl3UhURgSjTOx3B6CzTkPNGnZY3782I/fqFkz708eeqciUh5uvb3 ubu/iWdAy61TSEXu0pgeSdHHLUAN5J5/Q6KAsoNocFrNk6NEL24PzEbw9GebqvUeVcAN PmDOS7YIgb1IcXiATIbnO/dsZmyqb89jfazz0U2QSVWhyK1qjKFsenTuXQ2TIDb4ls+z HZYHsf6lfIEdxChFBC6kPq8gnGWOBf4YcBMZIGtYNgWFlV6NNo51DOqr/mkyr2oj8xe2 bStIJC0cLfC9pNN4GIsZ2n+UpMniSewssWqZLkZEu2qaGu6XrThYkCGM1UEficH8LnaU 4e1g== 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 c17si2060020pls.411.2019.06.06.10.04.06; Thu, 06 Jun 2019 10:04:23 -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 S1727721AbfFFMuJ (ORCPT + 99 others); Thu, 6 Jun 2019 08:50:09 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:50026 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfFFMuJ (ORCPT ); Thu, 6 Jun 2019 08:50:09 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 32D5380262; Thu, 6 Jun 2019 14:49:57 +0200 (CEST) Date: Thu, 6 Jun 2019 14:50:06 +0200 From: Pavel Machek To: pavel@ucw.cz Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Kangjie Lu , Matthias Schwarzott , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: Re: [PATCH 4.19 249/276] media: si2165: fix a missing check of return value Message-ID: <20190606125006.GB27432@amd> References: <20190530030523.133519668@linuxfoundation.org> <20190530030540.713606171@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CdrF4e02JqNVZeln" Content-Disposition: inline In-Reply-To: <20190530030540.713606171@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CdrF4e02JqNVZeln Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > [ Upstream commit 0ab34a08812a3334350dbaf69a018ee0ab3d2ddd ] >=20 > si2165_readreg8() may fail. Looking into si2165_readreg8(), we will find > that "val_tmp" will be an uninitialized value when regmap_read() fails. > "val_tmp" is then assigned to "val". So if si2165_readreg8() fails, > "val" will be a random value. Further use will lead to undefined > behaviors. The fix checks if si2165_readreg8() fails, and if so, returns > its error code upstream. Ok, but there's still undefined behaviour in si2165_readreg8, 16 and 24, where it manipulates and prints uninitialized memory, right? Pavel =09 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --CdrF4e02JqNVZeln Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlz5C/4ACgkQMOfwapXb+vKnbwCgjf8g1YCjHfmt2pq0lnCO8Hbt TpYAni4HDZ+1op9LKWmHXuBpGoW0nkXY =ukvM -----END PGP SIGNATURE----- --CdrF4e02JqNVZeln--