Re: [PATCH 1/2] media: cedrus: Fix missing cleanup in error path

From: Andrey Skvortsov

Date: Mon Apr 06 2026 - 17:23:52 EST


Hi,

On 26-04-02 16:09, Dan Carpenter wrote:
> On Wed, Apr 01, 2026 at 10:14:40PM +0300, Andrey Skvortsov wrote:
> > From: Samuel Holland <samuel@xxxxxxxxxxxx>
> >
> > From: Samuel Holland <samuel@xxxxxxxxxxxx>
> >
> > According to the documentation struct v4l2_fh has to be cleaned up with
> > v4l2_fh_exit() before being freed. [1]
> >
> > 1. https://docs.kernel.org/driver-api/media/v4l2-fh.html
> >
>
> I wish the commit message would say what the use visible effect of the
> bug is. I looked at it and I don't think this patch hurts but I also
> didn't necessarily see a that the original code had a user visible bug.
>
> I read the documentation but it wasn't as unambiguous as I'd prefer.
>

Thank you for the review. Currently there is no visible
bug. v4l2_fh_exit() in this case only destroys mutex.
But it may change in the future, when v4l2_fh_init/v4l2_fh_exit will
be changed. I think the change maybe useful in this regard.

I'll describe this in the commit message in v2 and resend it separately from the
patch 2, that fixes actual problem. So this change may be skipped, if
maintainers think it's not worth to apply.

--
Best regards,
Andrey Skvortsov