From: Martin Peschke <mp3@de.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
Wu Fengguang <wfg@mail.ustc.edu.cn>
Subject: [Patch] fix parsing of statistics type-attribute
Date: Tue, 06 Mar 2007 20:26:00 +0100 [thread overview]
Message-ID: <1173209160.5266.17.camel@dix> (raw)
Without this fix the the statistics user interface accepted, for example:
echo name=my_stats type=utilisa > definition
while it should only accept:
echo name=my_stats type=utilisation > definition
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
---
statistic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux/lib/statistic.c
===================================================================
--- linux.orig/lib/statistic.c
+++ linux/lib/statistic.c
@@ -506,7 +506,8 @@ static int statistic_parse_match(struct
len = (args[0].to - args[0].from);
for (type = 0; type < STAT_NONE; type++) {
disc = &statistic_discs[type];
- if (unlikely(strncmp(disc->name, args[0].from, len)))
+ if (strlen(disc->name) != len ||
+ strncmp(disc->name, args[0].from, len))
continue;
return statistic_parse_single(stat, info, def, type);
}
reply other threads:[~2007-03-06 19:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1173209160.5266.17.camel@dix \
--to=mp3@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=wfg@mail.ustc.edu.cn \
/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 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.