Commit e5e59f81 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: only initialize mode if pipe is not null

During atomisp register, udev tries to open all devices. For
some, pipe is NULL, at least during register time, causing the
driver to try to access a NULL pointer.

So, add an extra check to avoid such condition.

Link: https://lore.kernel.org/linux-media/6406265f2d5f3791d5c7cbd1364186217f19524c.1636364423.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent cb4d67a9
...@@ -901,7 +901,7 @@ static int atomisp_open(struct file *file) ...@@ -901,7 +901,7 @@ static int atomisp_open(struct file *file)
rt_mutex_unlock(&isp->mutex); rt_mutex_unlock(&isp->mutex);
/* Ensure that a mode is set */ /* Ensure that a mode is set */
if (asd) if (asd && pipe)
v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode); v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode);
return 0; return 0;
......
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