mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
media: v4l2-async: Safely unregister an non-registered async subdev
Make the V4L2 async framework a bit more robust by allowing to unregister a non-registered async subdev. Otherwise the v4l2_async_cleanup() will attempt to delete the async subdev from the subdev_list with the corresponding list_head not initialized. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
b7cdd6453c
commit
25a6436002
@@ -813,6 +813,9 @@ EXPORT_SYMBOL(v4l2_async_register_subdev);
|
||||
|
||||
void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
|
||||
{
|
||||
if (!sd->async_list.next)
|
||||
return;
|
||||
|
||||
mutex_lock(&list_lock);
|
||||
|
||||
__v4l2_async_notifier_unregister(sd->subdev_notifier);
|
||||
|
||||
Reference in New Issue
Block a user