Skip to content
Commit aead0ffb authored by Eugen Hristev's avatar Eugen Hristev Committed by Mauro Carvalho Chehab
Browse files

media: v4l2-core: fix entity initialization in device_register_subdev



The entity variable was being initialized in the wrong place, before the
parameters have been checked.
To solve this, completely removed the entity variable and replaced it
with the initialization value : &sd->entity.
This will avoid dereferencing 'sd' pointer before it's being checked if
it's NULL.

Fixes: 61f5db54 ("[media] v4l: Make v4l2_subdev inherit from media_entity")

Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 6990570f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment