mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] proc/stat: use defined macro KMALLOC_MAX_SIZE
@ 2011-03-22  9:41 Yuanhan Liu
  0 siblings, 0 replies; only message in thread
From: Yuanhan Liu @ 2011-03-22  9:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: viro, Yuanhan Liu

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>
---
 fs/proc/stat.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 1cffa2b..9758b65 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)
 	struct seq_file *m;
 	int res;
 
-	/* don't ask for more than the kmalloc() max size, currently 128 KB */
-	if (size > 128 * 1024)
-		size = 128 * 1024;
+	/* don't ask for more than the kmalloc() max size */
+	if (size > KMALLOC_MAX_SIZE)
+		size = KMALLOC_MAX_SIZE;
 	buf = kmalloc(size, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
-- 
1.7.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-22  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-22  9:41 [PATCH] proc/stat: use defined macro KMALLOC_MAX_SIZE Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®