浏览代码

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>
Li Zefan 16 年之前
父节点
当前提交
7635b03adf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      kernel/trace/blktrace.c

+ 1 - 1
kernel/trace/blktrace.c

@@ -327,7 +327,7 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
 	char *msg;
 	char *msg;
 	struct blk_trace *bt;
 	struct blk_trace *bt;
 
 
-	if (count > BLK_TN_MAX_MSG - 1)
+	if (count >= BLK_TN_MAX_MSG)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	msg = kmalloc(count + 1, GFP_KERNEL);
 	msg = kmalloc(count + 1, GFP_KERNEL);