2.4.36-stable kernel tree
Revision | d4a1380db55cbf262bcc24b448b5061fab65113d (tree) |
---|---|
Time | 2006-09-29 06:20:38 |
Author | Michael Chen <micche@ati....> |
Commiter | Willy Tarreau |
[PATCH] i386: fix overflow in vmap on an x86 system which has more than 4GB memory.
(max_mapnr << PAGE_SHIFT) would overflow on a system which has
4GB memory or more, and so could cause vmap to fail every time.
Signed-off-by: Michael Chen <micche@ati.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
@@ -293,7 +293,7 @@ void * vmap(struct page **pages, int count, | ||
293 | 293 | struct vm_struct *area; |
294 | 294 | unsigned long size = count << PAGE_SHIFT; |
295 | 295 | |
296 | - if (!size || size > (max_mapnr << PAGE_SHIFT)) | |
296 | + if (count <= 0 || count > max_mapnr) | |
297 | 297 | return NULL; |
298 | 298 | area = get_vm_area(size, flags); |
299 | 299 | if (!area) { |