Re: [PATCH 4.19 211/306] media: ov13858: Check for possible null pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pavel,

On Tue, Dec 03, 2019 at 11:22:50AM +0100, Pavel Machek wrote:
> Hi!
> 
> > From: Chiranjeevi Rapolu <chiranjeevi.rapolu@xxxxxxxxx>
> > 
> > [ 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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux