From: Paolo Bonzini <pbonzini@redhat.com>
To: Liu Shuo <shuo.a.liu@intel.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Zhang Yanmin" <yanmin_zhang@linux.intel.com>,
"He Bo" <bo.he@intel.com>, "Liu Shuo" <shuox.liu@gmail.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH] KVM: release anon file in failure path of vm creation
Date: Tue, 12 Jul 2016 12:24:39 +0200 [thread overview]
Message-ID: <28049c2a-1b49-1909-52ce-105859e14e33@redhat.com> (raw)
In-Reply-To: <1468316323-23835-1-git-send-email-shuo.a.liu@intel.com>
On 12/07/2016 11:38, Liu Shuo wrote:
> The failure of create debugfs of VM will return directly without release
> the anon file. It will leak memory and file descriptors, even through
> be not serious.
>
> Signed-off-by: Liu Shuo <shuo.a.liu@intel.com>
> ---
> virt/kvm/kvm_main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 48bd520..8322154 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -49,6 +49,7 @@
> #include <linux/slab.h>
> #include <linux/sort.h>
> #include <linux/bsearch.h>
> +#include <linux/syscalls.h>
>
> #include <asm/processor.h>
> #include <asm/io.h>
> @@ -3067,6 +3068,7 @@ static int kvm_dev_ioctl_create_vm(unsigned long type)
>
> if (kvm_create_vm_debugfs(kvm, r) < 0) {
> kvm_put_kvm(kvm);
> + sys_close(r);
> return -ENOMEM;
> }
>
>
Thanks, applied to kvm/master.
Paolo
next prev parent reply other threads:[~2016-07-12 10:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 9:38 Liu Shuo
2016-07-12 10:24 ` Paolo Bonzini [this message]
2016-07-14 16:46 ` Al Viro
2016-07-14 16:56 ` Paolo Bonzini
2016-07-15 2:22 ` Liu Shuo
2016-07-15 2:26 ` Al Viro
2016-07-15 3:18 ` Liu Shuo
2016-07-15 5:09 ` Al Viro
2016-07-15 7:04 ` Liu Shuo
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=28049c2a-1b49-1909-52ce-105859e14e33@redhat.com \
--to=pbonzini@redhat.com \
--cc=bo.he@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=shuo.a.liu@intel.com \
--cc=shuox.liu@gmail.com \
--cc=yanmin_zhang@linux.intel.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®