Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a035f26 authored by Chiranjeevi Rapolu's avatar Chiranjeevi Rapolu Committed by Greg Kroah-Hartman
Browse files

media: ov13858: Check for possible null pointer



[ Upstream commit 35629182eb8f931b0de6ed38c0efac58e922c801 ]

Check for possible null pointer to avoid crash.

Signed-off-by: default avatarChiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3ee72f30
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1612,6 +1612,7 @@ static int ov13858_init_controls(struct ov13858 *ov13858)
				OV13858_NUM_OF_LINK_FREQS - 1,
				0,
				link_freq_menu_items);
	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]);
@@ -1635,6 +1636,7 @@ static int ov13858_init_controls(struct ov13858 *ov13858)
	ov13858->hblank = v4l2_ctrl_new_std(
				ctrl_hdlr, &ov13858_ctrl_ops, V4L2_CID_HBLANK,
				hblank, hblank, 1, hblank);
	if (ov13858->hblank)
		ov13858->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;

	exposure_max = mode->vts_def - 8;