[PATCH] KVM: Add missing fput() on error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Call fput() on this error path.

Fixes: fcbef1e5e5d2 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 virt/kvm/guest_memfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 7f62abe3df9e..039f1bb70a0c 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -473,7 +473,7 @@ int kvm_gmem_bind(struct kvm *kvm, struct kvm_memory_slot *slot,
 	inode = file_inode(file);
 
 	if (offset < 0 || !PAGE_ALIGNED(offset))
-		return -EINVAL;
+		goto err;
 
 	if (offset + size > i_size_read(inode))
 		goto err;
-- 
2.42.0





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux