Skip to contentSkip to conversation

fix return value after hugetlb mmap failure

PATCH New Anton Blanchard 1 participant 1 message Jun 30, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix return value after hugetlb mmap failure

Hi,

At the moment no one uses is_aligned_hugepage_range or is_hugepage_only_range, but it is reasonable to assume they return true or false.

On error we want to return -EINVAL back to userspace.

Anton

===== /mnt/kernels/linux-2.5/mm/mmap.c 1.86 vs edited =====

/mnt/kernels/linux-2.5/mm/mmap.c renamed from mm/mmap.c +1 -1
@@ -846,7 +846,7 @@
 			ret = is_hugepage_only_range(addr, len);
 		}
 		if (ret)
-			return ret;
+			return -EINVAL;
 		return addr;
 	}