Re: [PATCH] media: venus: venc: avoid double free on video register failure
From: Guangshuo Li
Date: Tue May 19 2026 - 11:10:09 EST
Hi Bryan,
On Tue, 19 May 2026 at 21:20, Bryan O'Donoghue <bod@xxxxxxxxxx> wrote:
>
> Yes I take your point.
>
> So what you are describing is an error in the software contract from
> video_register_device() - if we look throughout the usage of that
> function we see either the pattern we already have - not checking for
> NULL or checking for NULL - not the double free case you are addressing.
>
> So really the fix - the place to litigate this is not in Venus or Iris
> but in video_register_device's cleanup path.
>
> ---
> bod
Thanks, I agree.
This should probably be handled in the video_register_device() failure
path rather than in each individual driver.
I do not have a good idea yet for how to fix that cleanly in the v4l2
core. Do you have any suggestion?