aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2011-05-26 19:25:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 20:12:37 -0400
commita4dbf0ec2aa3e8aca6e63f598095750c232d50f1 (patch)
tree38ceee9851536b3f5969d642afb9614fba826f8e /fs/proc
parente130aa70f438855b4a0e13a5249951da001798d4 (diff)
proc/stat: use defined macro KMALLOC_MAX_SIZE
There is a macro for the max size kmalloc can allocate, so use it instead of a hardcoded number. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/stat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 1cffa2b8a2fc..9758b654a1bc 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -138,9 +138,9 @@ static int stat_open(struct inode *inode, struct file *file)
138 struct seq_file *m; 138 struct seq_file *m;
139 int res; 139 int res;
140 140
141 /* don't ask for more than the kmalloc() max size, currently 128 KB */ 141 /* don't ask for more than the kmalloc() max size */
142 if (size > 128 * 1024) 142 if (size > KMALLOC_MAX_SIZE)
143 size = 128 * 1024; 143 size = KMALLOC_MAX_SIZE;
144 buf = kmalloc(size, GFP_KERNEL); 144 buf = kmalloc(size, GFP_KERNEL);
145 if (!buf) 145 if (!buf)
146 return -ENOMEM; 146 return -ENOMEM;