mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Loic PALLARDY <loic.pallardy@st.com>
To: Suman Anna <s-anna@ti.com>,
	"bjorn.andersson@linaro.org" <bjorn.andersson@linaro.org>,
	"ohad@wizery.com" <ohad@wizery.com>
Cc: "linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Arnaud POULIQUEN" <arnaud.pouliquen@st.com>,
	"benjamin.gaignard@linaro.org" <benjamin.gaignard@linaro.org>
Subject: RE: [PATCH 1/1] rpmsg: virtio_rpmsg_bus: Fix rpmsg_create_channel memory leak
Date: Thu, 26 Jul 2018 07:04:23 +0000	[thread overview]
Message-ID: <fd10ef4f445641b2b333bffa5da225f6@SFHDAG7NODE2.st.com> (raw)
In-Reply-To: <19e8f6e7-3ee6-6606-164c-3bb953a13da5@ti.com>

Hi Suman,

> -----Original Message-----
> From: Suman Anna <s-anna@ti.com>
> Sent: Thursday, July 26, 2018 12:37 AM
> To: Loic PALLARDY <loic.pallardy@st.com>; bjorn.andersson@linaro.org;
> ohad@wizery.com
> Cc: linux-remoteproc@vger.kernel.org; linux-kernel@vger.kernel.org;
> Arnaud POULIQUEN <arnaud.pouliquen@st.com>;
> benjamin.gaignard@linaro.org
> Subject: Re: [PATCH 1/1] rpmsg: virtio_rpmsg_bus: Fix
> rpmsg_create_channel memory leak
> 
> Hi Loic,
> 
> On 07/25/2018 04:08 PM, Loic Pallardy wrote:
> > In case of rpmsg_register_device() failure, vch previously
> > allocated must be free.
> >
> 
> Isn't this already handled through the virtio_rpmsg_release_device()
> callback as part of the put_device() in rpmsg_register_device() failure.

Yes you're right, put_device() is doing the job.
Please forget this patch.

Regards,
Loic 

> 
> regards
> Suman
> 
> > fixes: 6eed598a0491 ("rpmsg: Split off generic tail of create_channel()")
> >
> > Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
> > ---
> >  drivers/rpmsg/virtio_rpmsg_bus.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c
> b/drivers/rpmsg/virtio_rpmsg_bus.c
> > index 664f957..10f927e 100644
> > --- a/drivers/rpmsg/virtio_rpmsg_bus.c
> > +++ b/drivers/rpmsg/virtio_rpmsg_bus.c
> > @@ -431,8 +431,10 @@ static struct rpmsg_device
> *rpmsg_create_channel(struct virtproc_info *vrp,
> >  	rpdev->dev.parent = &vrp->vdev->dev;
> >  	rpdev->dev.release = virtio_rpmsg_release_device;
> >  	ret = rpmsg_register_device(rpdev);
> > -	if (ret)
> > +	if (ret) {
> > +		kfree(vch);
> >  		return NULL;
> > +	}
> >
> >  	return rpdev;
> >  }
> >


      reply	other threads:[~2018-07-26  7:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 21:08 Loic Pallardy
2018-07-25 22:36 ` Suman Anna
2018-07-26  7:04   ` Loic PALLARDY [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd10ef4f445641b2b333bffa5da225f6@SFHDAG7NODE2.st.com \
    --to=loic.pallardy@st.com \
    --cc=arnaud.pouliquen@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®