summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-pae/0011-kernfs-fix-removed-error-check.patch
blob: b597595c64437e4025057ae6566dbfe7af7df6f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index 8034706..e01ea4a 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -484,6 +484,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
 
 	ops = kernfs_ops(of->kn);
 	rc = ops->mmap(of, vma);
+	if (rc)
+		goto out_put;
 
 	/*
 	 * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()