From: aq <aquynh@gmail.com>
To: lkml <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] memparse bugfix
Date: Sat, 16 Jul 2005 02:30:57 +0900 [thread overview]
Message-ID: <9cde8bff05071510307c7beb4@mail.gmail.com> (raw)
[-- 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;
next reply other threads:[~2005-07-15 17:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-15 17:30 aq [this message]
2005-07-15 18:12 ` Chris Wright
2005-07-15 18:29 ` aq
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9cde8bff05071510307c7beb4@mail.gmail.com \
--to=aquynh@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®