public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com,
	mingo@redhat.com, lizf@cn.fujitsu.com, alan.brunelle@hp.com,
	jens.axboe@oracle.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:tracing/blktrace-v2] blktrace: small cleanup in blk_msg_write()
Date: Fri, 3 Apr 2009 12:51:41 GMT	[thread overview]
Message-ID: <tip-7635b03adf3d7b84da7649b81efa91e6ebf11b85@git.kernel.org> (raw)
In-Reply-To: <49D5BB56.7000807@cn.fujitsu.com>

Commit-ID:  7635b03adf3d7b84da7649b81efa91e6ebf11b85
Gitweb:     http://git.kernel.org/tip/7635b03adf3d7b84da7649b81efa91e6ebf11b85
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Fri, 3 Apr 2009 15:31:34 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 14:48:11 +0200

blktrace: small cleanup in blk_msg_write()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "Alan D. Brunelle" <alan.brunelle@hp.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
LKML-Reference: <49D5BB56.7000807@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/trace/blktrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index a400b86..73d7860 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -327,7 +327,7 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
 	char *msg;
 	struct blk_trace *bt;
 
-	if (count > BLK_TN_MAX_MSG - 1)
+	if (count >= BLK_TN_MAX_MSG)
 		return -EINVAL;
 
 	msg = kmalloc(count + 1, GFP_KERNEL);

  parent reply	other threads:[~2009-04-03 12:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03  7:31 [PATCH] blktrace: fix a bug in blk_msg_write() Li Zefan
2009-04-03 11:17 ` Ingo Molnar
2009-04-03 12:27   ` Jens Axboe
2009-04-03 12:51     ` [tip:tracing/blktrace-v2] blktrace: NUL-terminate user space messages Carl Henrik Lunde
2009-04-03 12:52     ` [PATCH] blktrace: fix a bug in blk_msg_write() Ingo Molnar
2009-04-03 12:59       ` Ingo Molnar
2009-04-03 13:03         ` Jens Axboe
2009-04-03 12:51 ` Li Zefan [this message]
     [not found] ` <tip-48cefde3c17bbf37fee99e2889bcc718e5805dfa@git.kernel.org>
2009-04-08  1:32   ` [tip:tracing/blktrace-v2] " Li Zefan
2009-04-08  9:04     ` Ingo Molnar

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=tip-7635b03adf3d7b84da7649b81efa91e6ebf11b85@git.kernel.org \
    --to=lizf@cn.fujitsu.com \
    --cc=acme@redhat.com \
    --cc=alan.brunelle@hp.com \
    --cc=hpa@zytor.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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