diff options
author | Eugen Hristev <eugen.hristev@microchip.com> | 2020-02-26 16:28:16 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-03-05 22:45:03 +0100 |
commit | aead0ffbf078e0098ca6cfd1625029ff9347b10d (patch) | |
tree | a6b0b1f77cc6869fe699b891d2d95b84b062d576 /drivers/media/spi | |
parent | 6990570f7e0a6078e11b9c5dc13f4b6e3f49a398 (diff) |
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: 61f5db549dde ("[media] v4l: Make v4l2_subdev inherit from media_entity")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/spi')
0 files changed, 0 insertions, 0 deletions