[PATCH] drm/vc4: fix ref count leak in vc4_dsi_encoder_enable

Navid Emamdoost navid.emamdoost at gmail.com
Sun Jun 14 19:15:07 UTC 2020


On Sun, Jun 14, 2020 at 7:32 AM Andy Shevchenko
<andy.shevchenko at gmail.com> wrote:
>
> On Sun, Jun 14, 2020 at 9:55 AM Navid Emamdoost
> <navid.emamdoost at gmail.com> wrote:
> >
> > in vc4_dsi_encoder_enable, the call to pm_runtime_get_sync increments
> > the counter even in case of failure, leading to incorrect
> > ref count. In case of failure, decrement the ref count before returning.
>
> ...
>
> > +out:
> > +       pm_runtime_put(dev);
>
> Better to use pm_runtime_put_noidle() for error case.
> And here is a change of semantics, i.e. before your patch there was no
> put at all. How did you test this?
I had no way to test this but looked to me like a miscalculation of
ref count when there is a get and an error happens then the ref count
should be restored. Does that look incorrect?

>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Navid.


More information about the dri-devel mailing list