All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memparse bugfix
@ 2005-07-15 17:30 aq
  2005-07-15 18:12 ` Chris Wright
  0 siblings, 1 reply; 3+ messages in thread
From: aq @ 2005-07-15 17:30 UTC (permalink / raw)
  To: lkml, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

Function lib/cmdline.c:memparse() wrongly calculates the memory if the
given string has K/M/G suffix. This patch (against 2.6.13-rc3) fixes
the problem. Please apply.

Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>


# diffstat cmdline.patch 
 cmdline-aq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

[-- Attachment #2: cmdline.patch --]
[-- Type: application/octet-stream, Size: 365 bytes --]

--- 2.6.13-rc3/lib/cmdline.c	2005-04-30 10:31:37.000000000 +0900
+++ 2.6.13-rc3/lib/cmdline-aq.c	2005-07-16 02:25:26.000000000 +0900
@@ -100,10 +100,10 @@ unsigned long long memparse (char *ptr, 
 	switch (**retptr) {
 	case 'G':
 	case 'g':
-		ret <<= 10;
+		ret <<= 30;
 	case 'M':
 	case 'm':
-		ret <<= 10;
+		ret <<= 20;
 	case 'K':
 	case 'k':
 		ret <<= 10;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-15 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-15 17:30 [PATCH] memparse bugfix aq
2005-07-15 18:12 ` Chris Wright
2005-07-15 18:29   ` aq

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.