[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191203102250.GA27320@amd>
Date: Tue, 3 Dec 2019 11:22:50 +0100
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Chiranjeevi Rapolu <chiranjeevi.rapolu@...el.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 211/306] media: ov13858: Check for possible null
pointer
Hi!
> From: Chiranjeevi Rapolu <chiranjeevi.rapolu@...el.com>
>
> [ Upstream commit 35629182eb8f931b0de6ed38c0efac58e922c801 ]
>
> 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 *ov13858)
> OV13858_NUM_OF_LINK_FREQS - 1,
> 0,
> link_freq_menu_items);
> - ov13858->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
> + if (ov13858->link_freq)
> + ov13858->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
>
> pixel_rate_max = link_freq_to_pixel_rate(link_freq_menu_items[0]);
> pixel_rate_min =
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
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists