From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce Date: Sun, 27 Aug 2017 22:02:20 +0100 Message-ID: <20170827210220.GG5426@ZenIV.linux.org.uk> References: <20170822142823.69425-1-nixiaoming@huawei.com> <95fe182a-fd21-77a1-33df-0e609c2845fd@redhat.com> <8fd9a878-a8ce-5576-9a5c-1c221ff6ded7@redhat.com> <20170823060624.GA13958@fergus.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Nixiaoming , David Hildenbrand , "agraf@suse.com" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "benh@kernel.crashing.org" , "mpe@ellerman.id.au" , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" To: Paul Mackerras Return-path: Content-Disposition: inline In-Reply-To: <20170823060624.GA13958@fergus.ozlabs.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Aug 23, 2017 at 04:06:24PM +1000, Paul Mackerras wrote: > It seems to me that it would be better to do the anon_inode_getfd() > call before the kvm_get_kvm() call, and go to the fail label if it > fails. And what happens if another thread does close() on the (guessed) fd?