aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 644f746e167a..8688ae65ef58 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2813,7 +2813,7 @@ static struct swap_info_struct *alloc_swap_info(void)
2813 unsigned int type; 2813 unsigned int type;
2814 int i; 2814 int i;
2815 2815
2816 p = kzalloc(sizeof(*p), GFP_KERNEL); 2816 p = kvzalloc(sizeof(*p), GFP_KERNEL);
2817 if (!p) 2817 if (!p)
2818 return ERR_PTR(-ENOMEM); 2818 return ERR_PTR(-ENOMEM);
2819 2819
@@ -2824,7 +2824,7 @@ static struct swap_info_struct *alloc_swap_info(void)
2824 } 2824 }
2825 if (type >= MAX_SWAPFILES) { 2825 if (type >= MAX_SWAPFILES) {
2826 spin_unlock(&swap_lock); 2826 spin_unlock(&swap_lock);
2827 kfree(p); 2827 kvfree(p);
2828 return ERR_PTR(-EPERM); 2828 return ERR_PTR(-EPERM);
2829 } 2829 }
2830 if (type >= nr_swapfiles) { 2830 if (type >= nr_swapfiles) {
@@ -2838,7 +2838,7 @@ static struct swap_info_struct *alloc_swap_info(void)
2838 smp_wmb(); 2838 smp_wmb();
2839 nr_swapfiles++; 2839 nr_swapfiles++;
2840 } else { 2840 } else {
2841 kfree(p); 2841 kvfree(p);
2842 p = swap_info[type]; 2842 p = swap_info[type];
2843 /* 2843 /*
2844 * Do not memset this entry: a racing procfs swap_next() 2844 * Do not memset this entry: a racing procfs swap_next()