[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191203103123.GA32127@paasikivi.fi.intel.com>
Date: Tue, 3 Dec 2019 12:31:23 +0200
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Pavel Machek <pavel@...x.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Chiranjeevi Rapolu <chiranjeevi.rapolu@...el.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 Pavel,
On Tue, Dec 03, 2019 at 11:22:50AM +0100, Pavel Machek wrote:
> 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?
The patch fixes the problem. The rest could be debated, but LMML is the
right place for that debate.
--
Regard,s
Sakari Ailus
Powered by blists - more mailing lists