diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/Kconfig | 8 | ||||
-rw-r--r-- | mm/fremap.c | 5 | ||||
-rw-r--r-- | mm/hugetlb.c | 8 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 8 | ||||
-rw-r--r-- | mm/process_vm_access.c | 8 |
5 files changed, 21 insertions, 16 deletions
diff --git a/mm/Kconfig b/mm/Kconfig index ae55c1e04d10..3bea74f1ccfe 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -286,8 +286,12 @@ config NR_QUICK | |||
286 | default "1" | 286 | default "1" |
287 | 287 | ||
288 | config VIRT_TO_BUS | 288 | config VIRT_TO_BUS |
289 | def_bool y | 289 | bool |
290 | depends on HAVE_VIRT_TO_BUS | 290 | help |
291 | An architecture should select this if it implements the | ||
292 | deprecated interface virt_to_bus(). All new architectures | ||
293 | should probably not select this. | ||
294 | |||
291 | 295 | ||
292 | config MMU_NOTIFIER | 296 | config MMU_NOTIFIER |
293 | bool | 297 | bool |
diff --git a/mm/fremap.c b/mm/fremap.c index 0cd4c11488ed..4723ac8d2fc2 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -129,7 +129,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, | |||
129 | struct vm_area_struct *vma; | 129 | struct vm_area_struct *vma; |
130 | int err = -EINVAL; | 130 | int err = -EINVAL; |
131 | int has_write_lock = 0; | 131 | int has_write_lock = 0; |
132 | vm_flags_t vm_flags; | 132 | vm_flags_t vm_flags = 0; |
133 | 133 | ||
134 | if (prot) | 134 | if (prot) |
135 | return err; | 135 | return err; |
@@ -254,7 +254,8 @@ get_write_lock: | |||
254 | */ | 254 | */ |
255 | 255 | ||
256 | out: | 256 | out: |
257 | vm_flags = vma->vm_flags; | 257 | if (vma) |
258 | vm_flags = vma->vm_flags; | ||
258 | if (likely(!has_write_lock)) | 259 | if (likely(!has_write_lock)) |
259 | up_read(&mm->mmap_sem); | 260 | up_read(&mm->mmap_sem); |
260 | else | 261 | else |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0a0be33bb199..ca9a7c6d7e97 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2124,8 +2124,12 @@ int hugetlb_report_node_meminfo(int nid, char *buf) | |||
2124 | /* Return the number pages of memory we physically have, in PAGE_SIZE units. */ | 2124 | /* Return the number pages of memory we physically have, in PAGE_SIZE units. */ |
2125 | unsigned long hugetlb_total_pages(void) | 2125 | unsigned long hugetlb_total_pages(void) |
2126 | { | 2126 | { |
2127 | struct hstate *h = &default_hstate; | 2127 | struct hstate *h; |
2128 | return h->nr_huge_pages * pages_per_huge_page(h); | 2128 | unsigned long nr_total_pages = 0; |
2129 | |||
2130 | for_each_hstate(h) | ||
2131 | nr_total_pages += h->nr_huge_pages * pages_per_huge_page(h); | ||
2132 | return nr_total_pages; | ||
2129 | } | 2133 | } |
2130 | 2134 | ||
2131 | static int hugetlb_acct_memory(struct hstate *h, long delta) | 2135 | static int hugetlb_acct_memory(struct hstate *h, long delta) |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index b81a367b9f39..ee3765760818 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -1779,7 +1779,11 @@ void try_offline_node(int nid) | |||
1779 | for (i = 0; i < MAX_NR_ZONES; i++) { | 1779 | for (i = 0; i < MAX_NR_ZONES; i++) { |
1780 | struct zone *zone = pgdat->node_zones + i; | 1780 | struct zone *zone = pgdat->node_zones + i; |
1781 | 1781 | ||
1782 | if (zone->wait_table) | 1782 | /* |
1783 | * wait_table may be allocated from boot memory, | ||
1784 | * here only free if it's allocated by vmalloc. | ||
1785 | */ | ||
1786 | if (is_vmalloc_addr(zone->wait_table)) | ||
1783 | vfree(zone->wait_table); | 1787 | vfree(zone->wait_table); |
1784 | } | 1788 | } |
1785 | 1789 | ||
@@ -1801,7 +1805,7 @@ int __ref remove_memory(int nid, u64 start, u64 size) | |||
1801 | int retry = 1; | 1805 | int retry = 1; |
1802 | 1806 | ||
1803 | start_pfn = PFN_DOWN(start); | 1807 | start_pfn = PFN_DOWN(start); |
1804 | end_pfn = start_pfn + PFN_DOWN(size); | 1808 | end_pfn = PFN_UP(start + size - 1); |
1805 | 1809 | ||
1806 | /* | 1810 | /* |
1807 | * When CONFIG_MEMCG is on, one memory block may be used by other | 1811 | * When CONFIG_MEMCG is on, one memory block may be used by other |
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c index 926b46649749..fd26d0433509 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c | |||
@@ -429,12 +429,6 @@ compat_process_vm_rw(compat_pid_t pid, | |||
429 | if (flags != 0) | 429 | if (flags != 0) |
430 | return -EINVAL; | 430 | return -EINVAL; |
431 | 431 | ||
432 | if (!access_ok(VERIFY_READ, lvec, liovcnt * sizeof(*lvec))) | ||
433 | goto out; | ||
434 | |||
435 | if (!access_ok(VERIFY_READ, rvec, riovcnt * sizeof(*rvec))) | ||
436 | goto out; | ||
437 | |||
438 | if (vm_write) | 432 | if (vm_write) |
439 | rc = compat_rw_copy_check_uvector(WRITE, lvec, liovcnt, | 433 | rc = compat_rw_copy_check_uvector(WRITE, lvec, liovcnt, |
440 | UIO_FASTIOV, iovstack_l, | 434 | UIO_FASTIOV, iovstack_l, |
@@ -459,8 +453,6 @@ free_iovecs: | |||
459 | kfree(iov_r); | 453 | kfree(iov_r); |
460 | if (iov_l != iovstack_l) | 454 | if (iov_l != iovstack_l) |
461 | kfree(iov_l); | 455 | kfree(iov_l); |
462 | |||
463 | out: | ||
464 | return rc; | 456 | return rc; |
465 | } | 457 | } |
466 | 458 | ||