Re: [PATCH] media: v4l2-async: avoid deleting unlinked ASC entry on link error

From: Sakari Ailus

Date: Tue Aug 11 2026 - 02:22:02 EST


Hi Rao,

On Mon, Aug 10, 2026 at 05:50:12PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@xxxxxxxxxxxxx>
>
> v4l2_async_match_notify() creates ancillary media links before adding
> asc->asc_subdev_entry to sd->asc_list.
>
> If ancillary link creation fails, the function jumps to
> err_call_unbind while asc_subdev_entry has not been linked yet. Async
> connections are zero-allocated, so the list entry still has NULL next
> and prev pointers on this path. Calling list_del() on it can therefore
> dereference NULL instead of returning the original link creation error.
>
> Do not delete asc_subdev_entry from err_call_unbind. There is no list
> insertion to undo on this path; the bound callback and sub-device
> registration are the operations that need to be rolled back.
>
> Fixes: 28a1295795d8 ("media: v4l: async: Allow multiple connections between entities")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Xu Rao <raoxu@xxxxxxxxxxxxx>

Can you resend this, please? Somehow Patchwork didn't pick it up.

--
Regards,

Sakari Ailus