lkml.org 
[lkml]   [2019]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.19 211/306] media: ov13858: Check for possible null pointer
Hi!

> From: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-12-03 11:23    [W:0.810 / U:22.884 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site