mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
camera: channel: Make sure csi channels are initailized before access
There is case where CSI channels are initialized later before accessing it. In this case, it can cause NULL pointer access. Add checks before accessing it in the function tegra_channel_find_linked_csi_subdev(). Bug 4346767 Change-Id: I752898af4b2164540cbd2e071ee36af4cd5f6fde Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3039709 GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b2dcbdbc93
commit
1729ced2bf
@@ -2007,6 +2007,9 @@ struct v4l2_subdev *tegra_channel_find_linked_csi_subdev(
|
||||
struct tegra_csi_channel *csi_it;
|
||||
int i = 0;
|
||||
|
||||
if (!csi)
|
||||
return NULL;
|
||||
|
||||
list_for_each_entry(csi_it, &csi->csi_chans, list) {
|
||||
for (i = 0; i < chan->num_subdevs; i++)
|
||||
if (chan->subdev[i] == &csi_it->subdev)
|
||||
|
||||
Reference in New Issue
Block a user