Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1141877ybl; Tue, 3 Dec 2019 02:23:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxaCU3BfvR5XrVJDhCJKy2GRtskxAv7edncWtkDwdA5CN88uqRPYO/x1F/Mdr1orfHF8Hg8 X-Received: by 2002:aca:1e11:: with SMTP id m17mr3004787oic.100.1575368635654; Tue, 03 Dec 2019 02:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575368635; cv=none; d=google.com; s=arc-20160816; b=vVggjVFdnsJKfxMW7/17TzTH2qmPVQjBWoJaEuKT1PB1SwsCzNVZjdhj4tmNv9zYT0 AVFTZLScfX/5e/sNm4YwBU0OSC7xKmH9qDJnI8XS5A3cN+Y/+xCjE1m8rVa3mi28+iVe edoUcHaE4zeamj/H+za1WOBhy3q/uj5OL4hpFjPgLeJAA6E0XOb8rsLus1b2CvpXmiAh cr/EujVHJ9ccunHUEztQFY/1gtRz7t/6vu860dbTcyLWZn3KzysUy4dRNZMIqnzF7d/N a4oNvgD2ZV52VjxwxW87Rk3olM61+h42reSklZX5rDLG4FTJem7SSuGfudmPYUkzO6Xo oLIA== 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=IHaUjCGZxPKYRoi753X6XQoCMWiKM37TpKSKyPycyL0=; b=NBEuPisIzG3yr/9SYb7NZTnA2uGzyMjFuZuzWVvRTWroJISKJq6OCsFB17aIjY4SdE O3FqXNrpOhaQ8fDg0ipo+ycbZAGaPzSK7aJ2GQb19k5CtUAoCnlM68v6X0Zooxodwoop 7KPkLg49WDnMdk88qE5sSJwjxbUJwflbGabH3leB5MXaKbpJwEU+UXBs0V1S5iX0EbXW hlSOeTt2VZhR3cugYnB7RuMp4qQNCISnz4aOluHQzaDCBH9q4eWACw04DHl0usDCInpT Wdc8MIX3R0OmdEyN4AgrqVDhKKbwtWzftGGGmkUcfUqxkY7o//sOUjpHXLl8csADmYWB Bvww== 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 w4si962458otl.214.2019.12.03.02.23.43; Tue, 03 Dec 2019 02:23:55 -0800 (PST) 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 S1726115AbfLCKWx (ORCPT + 99 others); Tue, 3 Dec 2019 05:22:53 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:37340 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbfLCKWw (ORCPT ); Tue, 3 Dec 2019 05:22:52 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id E6E531C25CF; Tue, 3 Dec 2019 11:22:50 +0100 (CET) Date: Tue, 3 Dec 2019 11:22:50 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Chiranjeevi Rapolu , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: Re: [PATCH 4.19 211/306] media: ov13858: Check for possible null pointer Message-ID: <20191203102250.GA27320@amd> References: <20191127203114.766709977@linuxfoundation.org> <20191127203130.540872040@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <20191127203130.540872040@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 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Chiranjeevi Rapolu >=20 > [ Upstream commit 35629182eb8f931b0de6ed38c0efac58e922c801 ] >=20 > Check for possible null pointer to avoid crash. > diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c > index 0e7a85c4996c7..afd66d243403b 100644 > --- a/drivers/media/i2c/ov13858.c > +++ b/drivers/media/i2c/ov13858.c > @@ -1612,7 +1612,8 @@ static int ov13858_init_controls(struct ov13858 *ov= 13858) > OV13858_NUM_OF_LINK_FREQS - 1, > 0, > link_freq_menu_items); > - ov13858->link_freq->flags |=3D V4L2_CTRL_FLAG_READ_ONLY; > + if (ov13858->link_freq) > + ov13858->link_freq->flags |=3D V4L2_CTRL_FLAG_READ_ONLY; > =20 > pixel_rate_max =3D link_freq_to_pixel_rate(link_freq_menu_items[0]); > pixel_rate_min =3D I don't think this is right fix. If ov13858->link_freq initialization fails, we want to fail the initialization, not present half-initialized device to userland, no? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl3mN3kACgkQMOfwapXb+vKiSACguJff7ExHy9eC8bWnsSV+Ndph KHcAoLasf4QJOMo9rBzIW6QdMs5qVbvq =Iz20 -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7--