From: "Jan Beulich" <JBeulich@suse.com>
To: "Daeseok Youn" <daeseok.youn@gmail.com>, <konrad.wilk@oracle.com>
Cc: <david.vrabel@citrix.com>, <xen-devel@lists.xenproject.org>,
<boris.ostrovsky@oracle.com>, <joe@perches.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] xen: fix memory leak in __xen_pcibk_add_pci_dev()
Date: Tue, 01 Apr 2014 11:48:26 +0100 [thread overview]
Message-ID: <533AB59A020000780000409F@nat28.tlf.novell.com> (raw)
In-Reply-To: <2172979.BN2CJo57Rq@daeseok-laptop.cloud.net>
>>> On 01.04.14 at 12:15, <daeseok.youn@gmail.com> wrote:
> It need to free dev_entry when it failed to assign to a new
> slot on the virtual PCI bus.
>
> smatch says:
> drivers/xen/xen-pciback/vpci.c:142 __xen_pcibk_add_pci_dev() warn:
> possible memory leak of 'dev_entry'
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
As before
Reviewed-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2: The kfree() invocation is moved outside the locked region.
>
> drivers/xen/xen-pciback/vpci.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c
> index 3165ce3..51afff9 100644
> --- a/drivers/xen/xen-pciback/vpci.c
> +++ b/drivers/xen/xen-pciback/vpci.c
> @@ -137,6 +137,8 @@ unlock:
> /* Publish this device. */
> if (!err)
> err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid);
> + else
> + kfree(dev_entry);
>
> out:
> return err;
> --
> 1.7.4.4
next prev parent reply other threads:[~2014-04-01 10:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 10:15 Daeseok Youn
2014-04-01 10:48 ` Jan Beulich [this message]
2014-04-03 11:55 ` David Vrabel
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=533AB59A020000780000409F@nat28.tlf.novell.com \
--to=jbeulich@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=daeseok.youn@gmail.com \
--cc=david.vrabel@citrix.com \
--cc=joe@perches.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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®