]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: stm32-csi: Fix dereference before NULL check
authorChandra Mohan Sundar <chandramohan.explore@gmail.com>
Mon, 18 Aug 2025 09:31:57 +0000 (15:01 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 25 Aug 2025 13:40:44 +0000 (15:40 +0200)
commit80eaf32672871bd2623ce6ba13ffc1f018756580
treef527f99c18e72d77b4c871d10d309245535d893d
parent9d108d226224b91ad11e7cfcf846c2a1721b466d
media: stm32-csi: Fix dereference before NULL check

In 'stm32_csi_start', 'csidev->s_subdev' is dereferenced directly while
assigning a value to the 'src_pad'. However the same value is being
checked against NULL at a later point of time indicating that there
are chances that the value can be NULL.

Move the dereference after the NULL check.

Fixes: e7bad98c205d1 ("media: v4l: Convert the users of v4l2_get_link_freq to call it on a pad")
Cc: stable@vger.kernel.org
Signed-off-by: Chandra Mohan Sundar <chandramohan.explore@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/st/stm32/stm32-csi.c