Commit 3e62aba8 authored by Marek Vasut's avatar Marek Vasut Committed by Mauro Carvalho Chehab

media: imx-mipi-csis: Check csis_fmt validity before use

The find_csis_format() may return NULL in case supported format is not
found, check the return value of find_csis_format() before using the
result to avoid NULL pointer dereference.

Fixes: 11927d0f ("media: imx-mipi-csis: Use V4L2 subdev active state")
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 68e87ebf
...@@ -1109,6 +1109,9 @@ static int mipi_csis_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, ...@@ -1109,6 +1109,9 @@ static int mipi_csis_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
csis_fmt = find_csis_format(fmt->code); csis_fmt = find_csis_format(fmt->code);
v4l2_subdev_unlock_state(state); v4l2_subdev_unlock_state(state);
if (!csis_fmt)
return -EPIPE;
fd->type = V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL; fd->type = V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL;
fd->num_entries = 1; fd->num_entries = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment