[PATCH] drm/imx: fix memory leak in imx_pd_bind
navid.emamdoost at gmail.com
Sat Oct 12 19:22:18 UTC 2019
No, that is not correct! You should not try to free imxpd here as it
is a resource-managed allocation via devm_kzalloc(). It means memory
allocated with this function is automatically freed on driver detach.
So, this patch introduces a double-free.
On Sat, Oct 12, 2019 at 6:54 AM Markus Elfring <Markus.Elfring at web.de> wrote:
> > +free_edid:
> > + kfree(imxpd->edid);
> > + return ret;
> I have taken another look at this change idea.
> Can the function call “devm_kfree(dev, imxpd)” become relevant
> also at this place?
> Would you like to combine it with the update suggestion
> “Fix error handling for a kmemdup() call in imx_pd_bind()”?
More information about the dri-devel