Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1e16428 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

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: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 2ea4cfc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -534,7 +534,7 @@ static void __v4l2_async_notifier_cleanup(struct v4l2_async_notifier *notifier)
{
{
	struct v4l2_async_subdev *asd, *tmp;
	struct v4l2_async_subdev *asd, *tmp;


	if (!notifier)
	if (!notifier || !notifier->asd_list.next)
		return;
		return;


	list_for_each_entry_safe(asd, tmp, &notifier->asd_list, asd_list) {
	list_for_each_entry_safe(asd, tmp, &notifier->asd_list, asd_list) {