Re: [PATCH] rpmsg: Release rpmsg devices in backends

From: Bjorn Andersson
Date: Sun Jun 25 2017 - 17:29:16 EST


On Fri 02 Jun 17:28 PDT 2017, Suman Anna wrote:

> Hi Bjorn,
>
> On 06/02/2017 05:07 AM, Henri Roosen wrote:
> > My suggestion would be to additionally change/fix
> > rpmsg_register_device() so it will not overwrite the release callback.
[..]
> FWIW, I didn't run into any rpmsg device memory leaks even without this
> patch with booting and shutting down of remoteproc devices. The
> virtio_rpmsg_channel structure inherits the struct rpmsg_device and is
> the one that gets allocated, and the release function plugged in
> rpmsg_release_device is operating on the rpmsg_device pointer, but both
> are actually the same pointer.
>
> Did you run into any memory leaks that required you to have this patch?
>

I did not see any memory leaks, because it happens that the pointers are
the same in all current cases.

But the code is wrong and should be fixed, thanks for pointing this out
Henri!

Regards,
Bjorn