diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2017-11-04 05:25:56 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-11-07 11:07:20 +0300 |
commit | 1453ad81a2be1bef9243671480694d483ab0dad0 (patch) | |
tree | 3a0bc9e1f3e7dae447ac9463171bc197e393ed78 /drivers/media/usb | |
parent | 580db6ca62c168733c6fd338cd2f0ebf39135283 (diff) | |
download | linux-1453ad81a2be1bef9243671480694d483ab0dad0.tar.xz |
media: v4l: async: fix unregister for implicitly registered sub-device notifiers
The commit aef69d54755d45ed ("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: aef69d54755d45ed ("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>
Diffstat (limited to 'drivers/media/usb')
0 files changed, 0 insertions, 0 deletions