Calling v4l2_async_notifier_unregister() on a notifier that hasn't been
registered leads to a crash. To simplify drivers, make it safe to
unregister a notifier that has not been registered.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
struct device *dev[n_subdev];
int i = 0;
+ if (!notifier->v4l2_dev)
+ return;
+
mutex_lock(&list_lock);
list_del(¬ifier->list);
}
put_device(d);
}
+
+ notifier->v4l2_dev = NULL;
+
/*
* Don't care about the waiting list, it is initialised and populated
* upon notifier registration.