Commit 6d8acd02 authored by Alexander Stein's avatar Alexander Stein Committed by Hans Verkuil

media: v4l: async: Fix notifier list entry init

struct v4l2_async_notifier has several list_head members, but only
waiting_list and done_list are initialized. notifier_entry was kept
'zeroed' leading to an uninitialized list_head.
This results in a NULL-pointer dereference if csi2_async_register() fails,
e.g. node for remote endpoint is disabled, and returns -ENOTCONN.
The following calls to v4l2_async_nf_unregister() results in a NULL
pointer dereference.
Add the missing list head initializer.

Fixes: b8ec754a ("media: v4l: async: Set v4l2_device and subdev in async notifier init")
Cc: <stable@vger.kernel.org> # for 6.6 and later
Signed-off-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 7cb8a625
...@@ -563,6 +563,7 @@ void v4l2_async_nf_init(struct v4l2_async_notifier *notifier, ...@@ -563,6 +563,7 @@ void v4l2_async_nf_init(struct v4l2_async_notifier *notifier,
{ {
INIT_LIST_HEAD(&notifier->waiting_list); INIT_LIST_HEAD(&notifier->waiting_list);
INIT_LIST_HEAD(&notifier->done_list); INIT_LIST_HEAD(&notifier->done_list);
INIT_LIST_HEAD(&notifier->notifier_entry);
notifier->v4l2_dev = v4l2_dev; notifier->v4l2_dev = v4l2_dev;
} }
EXPORT_SYMBOL(v4l2_async_nf_init); EXPORT_SYMBOL(v4l2_async_nf_init);
...@@ -572,6 +573,7 @@ void v4l2_async_subdev_nf_init(struct v4l2_async_notifier *notifier, ...@@ -572,6 +573,7 @@ void v4l2_async_subdev_nf_init(struct v4l2_async_notifier *notifier,
{ {
INIT_LIST_HEAD(&notifier->waiting_list); INIT_LIST_HEAD(&notifier->waiting_list);
INIT_LIST_HEAD(&notifier->done_list); INIT_LIST_HEAD(&notifier->done_list);
INIT_LIST_HEAD(&notifier->notifier_entry);
notifier->sd = sd; notifier->sd = sd;
} }
EXPORT_SYMBOL_GPL(v4l2_async_subdev_nf_init); EXPORT_SYMBOL_GPL(v4l2_async_subdev_nf_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment