diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2019-03-04 04:29:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-25 11:00:06 -0400 |
commit | d1e164289e55de90fcc5680f459a43972430a28d (patch) | |
tree | a2d0da1748bb39692f9fa0bce740a9a044d3b337 | |
parent | 2ea4cfc9a7163b48514361cb02d46b0546dfcc86 (diff) |
media: v4l2-async: Safely clean up an uninitialised notifier
Make the V4L2 async framework a bit more robust by allowing to clean up an
uninitialised notifier. Otherwise the result would be a (close to) NULL
pointer dereference.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-async.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index dc4f470ea6a7..8bde33c21ce4 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -534,7 +534,7 @@ static void __v4l2_async_notifier_cleanup(struct v4l2_async_notifier *notifier) { struct v4l2_async_subdev *asd, *tmp; - if (!notifier) + if (!notifier || !notifier->asd_list.next) return; list_for_each_entry_safe(asd, tmp, ¬ifier->asd_list, asd_list) { |