aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-10 18:17:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-10 18:17:24 -0400
commit7c283324da366a3e6ffaad4352a51a3c71fcae17 (patch)
treeb4d02c340a17ac5134889c4eec7dcd06d407e3ca
parent9e5869f8d70d94850cf86163c57ba8d4daa29924 (diff)
parent17ff3c1fa4c7bd0c38d751715033023ebf32fc96 (diff)
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc fixes from Andrew Morton. * emailed from Andrew Morton <akpm@linux-foundation.org>: (8 patches) MAINTAINERS: add maintainer for LED subsystem mm: nobootmem: fix sign extend problem in __free_pages_memory() drivers/leds: correct __devexit annotations memcg: free spare array to avoid memory leak namespaces, pid_ns: fix leakage on fork() failure hugetlb: prevent BUG_ON in hugetlb_fault() -> hugetlb_cow() mm: fix division by 0 in percpu_pagelist_fraction() proc/pid/pagemap: correctly report non-present ptes and holes between vmas
-rw-r--r--MAINTAINERS1
-rw-r--r--drivers/leds/leds-netxbig.c4
-rw-r--r--drivers/leds/leds-ns2.c2
-rw-r--r--fs/proc/task_mmu.c12
-rw-r--r--kernel/fork.c3
-rw-r--r--mm/hugetlb.c1
-rw-r--r--mm/memcontrol.c6
-rw-r--r--mm/nobootmem.c3
-rw-r--r--mm/page_alloc.c4
9 files changed, 26 insertions, 10 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 707163365a93..de4e2806030f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4034,6 +4034,7 @@ F: Documentation/scsi/53c700.txt
4034F: drivers/scsi/53c700* 4034F: drivers/scsi/53c700*
4035 4035
4036LED SUBSYSTEM 4036LED SUBSYSTEM
4037M: Bryan Wu <bryan.wu@canonical.com>
4037M: Richard Purdie <rpurdie@rpsys.net> 4038M: Richard Purdie <rpurdie@rpsys.net>
4038S: Maintained 4039S: Maintained
4039F: drivers/leds/ 4040F: drivers/leds/
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index d8433f2d53bc..73973fdbd8be 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -112,7 +112,7 @@ err_free_addr:
112 return err; 112 return err;
113} 113}
114 114
115static void __devexit gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) 115static void gpio_ext_free(struct netxbig_gpio_ext *gpio_ext)
116{ 116{
117 int i; 117 int i;
118 118
@@ -294,7 +294,7 @@ static ssize_t netxbig_led_sata_show(struct device *dev,
294 294
295static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); 295static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store);
296 296
297static void __devexit delete_netxbig_led(struct netxbig_led_data *led_dat) 297static void delete_netxbig_led(struct netxbig_led_data *led_dat)
298{ 298{
299 if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) 299 if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE)
300 device_remove_file(led_dat->cdev.dev, &dev_attr_sata); 300 device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index 2f0a14421a73..01cf89ec6944 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -255,7 +255,7 @@ err_free_cmd:
255 return ret; 255 return ret;
256} 256}
257 257
258static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) 258static void delete_ns2_led(struct ns2_led_data *led_dat)
259{ 259{
260 device_remove_file(led_dat->cdev.dev, &dev_attr_sata); 260 device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
261 led_classdev_unregister(&led_dat->cdev); 261 led_classdev_unregister(&led_dat->cdev);
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 2d60492d6df8..1030a716d155 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -747,6 +747,8 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, pte_t pte)
747 else if (pte_present(pte)) 747 else if (pte_present(pte))
748 *pme = make_pme(PM_PFRAME(pte_pfn(pte)) 748 *pme = make_pme(PM_PFRAME(pte_pfn(pte))
749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
750 else
751 *pme = make_pme(PM_NOT_PRESENT);
750} 752}
751 753
752#ifdef CONFIG_TRANSPARENT_HUGEPAGE 754#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -761,6 +763,8 @@ static void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,
761 if (pmd_present(pmd)) 763 if (pmd_present(pmd))
762 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset) 764 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset)
763 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 765 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
766 else
767 *pme = make_pme(PM_NOT_PRESENT);
764} 768}
765#else 769#else
766static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, 770static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,
@@ -801,8 +805,10 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
801 805
802 /* check to see if we've left 'vma' behind 806 /* check to see if we've left 'vma' behind
803 * and need a new, higher one */ 807 * and need a new, higher one */
804 if (vma && (addr >= vma->vm_end)) 808 if (vma && (addr >= vma->vm_end)) {
805 vma = find_vma(walk->mm, addr); 809 vma = find_vma(walk->mm, addr);
810 pme = make_pme(PM_NOT_PRESENT);
811 }
806 812
807 /* check that 'vma' actually covers this address, 813 /* check that 'vma' actually covers this address,
808 * and that it isn't a huge page vma */ 814 * and that it isn't a huge page vma */
@@ -830,6 +836,8 @@ static void huge_pte_to_pagemap_entry(pagemap_entry_t *pme,
830 if (pte_present(pte)) 836 if (pte_present(pte))
831 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset) 837 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset)
832 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 838 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
839 else
840 *pme = make_pme(PM_NOT_PRESENT);
833} 841}
834 842
835/* This function walks within one hugetlb entry in the single call */ 843/* This function walks within one hugetlb entry in the single call */
@@ -839,7 +847,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask,
839{ 847{
840 struct pagemapread *pm = walk->private; 848 struct pagemapread *pm = walk->private;
841 int err = 0; 849 int err = 0;
842 pagemap_entry_t pme = make_pme(PM_NOT_PRESENT); 850 pagemap_entry_t pme;
843 851
844 for (; addr != end; addr += PAGE_SIZE) { 852 for (; addr != end; addr += PAGE_SIZE) {
845 int offset = (addr & ~hmask) >> PAGE_SHIFT; 853 int offset = (addr & ~hmask) >> PAGE_SHIFT;
diff --git a/kernel/fork.c b/kernel/fork.c
index b9372a0bff18..687a15d56243 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -47,6 +47,7 @@
47#include <linux/audit.h> 47#include <linux/audit.h>
48#include <linux/memcontrol.h> 48#include <linux/memcontrol.h>
49#include <linux/ftrace.h> 49#include <linux/ftrace.h>
50#include <linux/proc_fs.h>
50#include <linux/profile.h> 51#include <linux/profile.h>
51#include <linux/rmap.h> 52#include <linux/rmap.h>
52#include <linux/ksm.h> 53#include <linux/ksm.h>
@@ -1464,6 +1465,8 @@ bad_fork_cleanup_io:
1464 if (p->io_context) 1465 if (p->io_context)
1465 exit_io_context(p); 1466 exit_io_context(p);
1466bad_fork_cleanup_namespaces: 1467bad_fork_cleanup_namespaces:
1468 if (unlikely(clone_flags & CLONE_NEWPID))
1469 pid_ns_release_proc(p->nsproxy->pid_ns);
1467 exit_task_namespaces(p); 1470 exit_task_namespaces(p);
1468bad_fork_cleanup_mm: 1471bad_fork_cleanup_mm:
1469 if (p->mm) 1472 if (p->mm)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 5a16423a512c..ae8f708e3d75 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2498,7 +2498,6 @@ retry_avoidcopy:
2498 if (outside_reserve) { 2498 if (outside_reserve) {
2499 BUG_ON(huge_pte_none(pte)); 2499 BUG_ON(huge_pte_none(pte));
2500 if (unmap_ref_private(mm, vma, old_page, address)) { 2500 if (unmap_ref_private(mm, vma, old_page, address)) {
2501 BUG_ON(page_count(old_page) != 1);
2502 BUG_ON(huge_pte_none(pte)); 2501 BUG_ON(huge_pte_none(pte));
2503 spin_lock(&mm->page_table_lock); 2502 spin_lock(&mm->page_table_lock);
2504 ptep = huge_pte_offset(mm, address & huge_page_mask(h)); 2503 ptep = huge_pte_offset(mm, address & huge_page_mask(h));
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 31ab9c3f0178..b659260c56ad 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4507,6 +4507,12 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
4507swap_buffers: 4507swap_buffers:
4508 /* Swap primary and spare array */ 4508 /* Swap primary and spare array */
4509 thresholds->spare = thresholds->primary; 4509 thresholds->spare = thresholds->primary;
4510 /* If all events are unregistered, free the spare array */
4511 if (!new) {
4512 kfree(thresholds->spare);
4513 thresholds->spare = NULL;
4514 }
4515
4510 rcu_assign_pointer(thresholds->primary, new); 4516 rcu_assign_pointer(thresholds->primary, new);
4511 4517
4512 /* To be sure that nobody uses thresholds */ 4518 /* To be sure that nobody uses thresholds */
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index e53bb8a256b1..1983fb1c7026 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -82,8 +82,7 @@ void __init free_bootmem_late(unsigned long addr, unsigned long size)
82 82
83static void __init __free_pages_memory(unsigned long start, unsigned long end) 83static void __init __free_pages_memory(unsigned long start, unsigned long end)
84{ 84{
85 int i; 85 unsigned long i, start_aligned, end_aligned;
86 unsigned long start_aligned, end_aligned;
87 int order = ilog2(BITS_PER_LONG); 86 int order = ilog2(BITS_PER_LONG);
88 87
89 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1); 88 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a712fb9e04ce..b21b3db15a7f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -105,7 +105,7 @@ unsigned long totalreserve_pages __read_mostly;
105 */ 105 */
106unsigned long dirty_balance_reserve __read_mostly; 106unsigned long dirty_balance_reserve __read_mostly;
107 107
108int percpu_pagelist_fraction; 108int percpu_pagelist_fraction = 8;
109gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK; 109gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;
110 110
111#ifdef CONFIG_PM_SLEEP 111#ifdef CONFIG_PM_SLEEP
@@ -5203,7 +5203,7 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write,
5203 int ret; 5203 int ret;
5204 5204
5205 ret = proc_dointvec_minmax(table, write, buffer, length, ppos); 5205 ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
5206 if (!write || (ret == -EINVAL)) 5206 if (!write || (ret < 0))
5207 return ret; 5207 return ret;
5208 for_each_populated_zone(zone) { 5208 for_each_populated_zone(zone) {
5209 for_each_possible_cpu(cpu) { 5209 for_each_possible_cpu(cpu) {