From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EEB5C28D1E for ; Thu, 6 Jun 2019 12:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A5B920872 for ; Thu, 6 Jun 2019 12:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727757AbfFFMuJ (ORCPT ); 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--