diff options
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r-- | mm/huge_memory.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index d94f7dee3997..d66010e0049d 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -422,7 +422,7 @@ static ssize_t scan_sleep_millisecs_store(struct kobject *kobj, | |||
422 | unsigned long msecs; | 422 | unsigned long msecs; |
423 | int err; | 423 | int err; |
424 | 424 | ||
425 | err = strict_strtoul(buf, 10, &msecs); | 425 | err = kstrtoul(buf, 10, &msecs); |
426 | if (err || msecs > UINT_MAX) | 426 | if (err || msecs > UINT_MAX) |
427 | return -EINVAL; | 427 | return -EINVAL; |
428 | 428 | ||
@@ -449,7 +449,7 @@ static ssize_t alloc_sleep_millisecs_store(struct kobject *kobj, | |||
449 | unsigned long msecs; | 449 | unsigned long msecs; |
450 | int err; | 450 | int err; |
451 | 451 | ||
452 | err = strict_strtoul(buf, 10, &msecs); | 452 | err = kstrtoul(buf, 10, &msecs); |
453 | if (err || msecs > UINT_MAX) | 453 | if (err || msecs > UINT_MAX) |
454 | return -EINVAL; | 454 | return -EINVAL; |
455 | 455 | ||
@@ -475,7 +475,7 @@ static ssize_t pages_to_scan_store(struct kobject *kobj, | |||
475 | int err; | 475 | int err; |
476 | unsigned long pages; | 476 | unsigned long pages; |
477 | 477 | ||
478 | err = strict_strtoul(buf, 10, &pages); | 478 | err = kstrtoul(buf, 10, &pages); |
479 | if (err || !pages || pages > UINT_MAX) | 479 | if (err || !pages || pages > UINT_MAX) |
480 | return -EINVAL; | 480 | return -EINVAL; |
481 | 481 | ||
@@ -543,7 +543,7 @@ static ssize_t khugepaged_max_ptes_none_store(struct kobject *kobj, | |||
543 | int err; | 543 | int err; |
544 | unsigned long max_ptes_none; | 544 | unsigned long max_ptes_none; |
545 | 545 | ||
546 | err = strict_strtoul(buf, 10, &max_ptes_none); | 546 | err = kstrtoul(buf, 10, &max_ptes_none); |
547 | if (err || max_ptes_none > HPAGE_PMD_NR-1) | 547 | if (err || max_ptes_none > HPAGE_PMD_NR-1) |
548 | return -EINVAL; | 548 | return -EINVAL; |
549 | 549 | ||
@@ -2301,6 +2301,8 @@ static void collapse_huge_page(struct mm_struct *mm, | |||
2301 | goto out; | 2301 | goto out; |
2302 | 2302 | ||
2303 | vma = find_vma(mm, address); | 2303 | vma = find_vma(mm, address); |
2304 | if (!vma) | ||
2305 | goto out; | ||
2304 | hstart = (vma->vm_start + ~HPAGE_PMD_MASK) & HPAGE_PMD_MASK; | 2306 | hstart = (vma->vm_start + ~HPAGE_PMD_MASK) & HPAGE_PMD_MASK; |
2305 | hend = vma->vm_end & HPAGE_PMD_MASK; | 2307 | hend = vma->vm_end & HPAGE_PMD_MASK; |
2306 | if (address < hstart || address + HPAGE_PMD_SIZE > hend) | 2308 | if (address < hstart || address + HPAGE_PMD_SIZE > hend) |