linux-stable/drivers/media/v4l2-core
Niklas Söderlund 1453ad81a2 media: v4l: async: fix unregister for implicitly registered sub-device notifiers
The commit aef69d5475 ("media: v4l: fwnode: Add a convenience
function for registering sensors") adds the function
v4l2_async_notifier_parse_fwnode_sensor_common() to parse and register a
subdevice and a subdev-notifier by parsing firmware information. This
new subdev-notifier is stored in the new field 'subdev_notifier' in
struct v4l2_subdev.

In v4l2_async_unregister_subdev() this field is used to unregister and
cleanup the subdev-notifier. A check for if the subdev-notifier is
initialized or not was forgotten leading to a NULL pointer dereference
in v4l2_async_notifier_cleanup() if a subdevice do not use the optional
convince function to initialize the field.

Fix this by checking in v4l2_async_notifier_cleanup() that it is
provided whit a notifier making it safe to call with a NULL parameter.

Fixes: aef69d5475 ("media: v4l: fwnode: Add a convenience function for registering sensors")

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-11-07 03:07:20 -05:00
..
Kconfig [media] v4l: fwnode: Support generic fwnode for parsing standardised properties 2017-06-06 09:25:16 -03:00
Makefile [media] v4l: Remove V4L2 OF framework in favour of V4L2 fwnode framework 2017-06-06 10:00:03 -03:00
tuner-core.c media: tuner-core: Remove unused #define PREFIX 2017-06-24 09:37:01 -03:00
v4l2-async.c media: v4l: async: fix unregister for implicitly registered sub-device notifiers 2017-11-07 03:07:20 -05:00
v4l2-clk.c media: Convert to using %pOF instead of full_name 2017-08-20 08:20:20 -04:00
v4l2-common.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
v4l2-compat-ioctl32.c media: v4l2-compat-ioctl32.c: add capabilities field to, v4l2_input32 2017-08-20 08:11:55 -04:00
v4l2-ctrls.c media: v4l2-ctrl: Fix flags field on Control events 2017-10-31 07:21:00 -04:00
v4l2-dev.c [media] v4l: Add metadata buffer type and format 2017-04-14 22:37:02 -03:00
v4l2-device.c [media] v4l: Allow calling v4l2_device_register_subdev_nodes() multiple times 2017-03-22 11:21:43 -03:00
v4l2-dv-timings.c [media] v4l2-dv-timings: add helpers for vic and pixelaspect ratio 2016-11-16 15:20:03 -02:00
v4l2-event.c [media] v4l2-core: Use kvmalloc() for potentially big allocations 2017-06-20 09:11:48 -03:00
v4l2-fh.c [media] media: Drop FSF's postal address from the source code files 2017-01-27 11:38:09 -02:00
v4l2-flash-led-class.c media: v4l2-flash-led-class: Create separate sub-devices for indicators 2017-08-26 20:26:35 -04:00
v4l2-fwnode.c media: v4l2-fwnode: use the cached value instead of getting again 2017-11-01 05:10:36 -04:00
v4l2-ioctl.c media: v4l-ioctl: Fix typo on v4l_print_frmsizeenum 2017-09-23 14:56:23 -04:00
v4l2-mc.c [media] media: Protect enable_source and disable_source handler code paths 2017-02-03 07:39:35 -02:00
v4l2-mem2mem.c [media] media: v4l2-mem2mem: extend m2m APIs for more accurate buffer management 2017-06-20 08:53:39 -03:00
v4l2-subdev.c [media] v4l2-core: Use kvmalloc() for potentially big allocations 2017-06-20 09:11:48 -03:00
v4l2-trace.c [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
vb2-trace.c [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
videobuf-core.c [media] v4l2-core: don't break long lines 2016-10-21 09:56:08 -02:00
videobuf-dma-contig.c
videobuf-dma-sg.c sched/headers: Prepare to remove the <linux/mm_types.h> dependency from <linux/sched.h> 2017-03-02 08:42:37 +01:00
videobuf-dvb.c
videobuf-vmalloc.c
videobuf2-core.c media: vb2: add bidirectional flag in vb2_queue 2017-08-26 14:15:54 -04:00
videobuf2-dma-contig.c media: vb2: add bidirectional flag in vb2_queue 2017-08-26 14:15:54 -04:00
videobuf2-dma-sg.c media: vb2: add bidirectional flag in vb2_queue 2017-08-26 14:15:54 -04:00
videobuf2-dvb.c [media] add media controller support to videobuf2-dvb 2016-02-10 07:23:41 -02:00
videobuf2-memops.c [media] vb2: convert vb2_vmarea_handler refcount from atomic_t to refcount_t 2017-04-05 15:31:57 -03:00
videobuf2-v4l2.c [media] v4l: Add metadata buffer type and format 2017-04-14 22:37:02 -03:00
videobuf2-vmalloc.c media: vb2: add bidirectional flag in vb2_queue 2017-08-26 14:15:54 -04:00