mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Dan Carpenter <error27@gmail.com>
Subject: [PATCH 7/7] trace: strlen() return doesnt account for the NULL
Date: Thu, 22 Jul 2010 16:24:18 -0400	[thread overview]
Message-ID: <20100722202453.766121554@goodmis.org> (raw)
In-Reply-To: <20100722202411.920807480@goodmis.org>

[-- Attachment #1: 0007-trace-strlen-return-doesn-t-account-for-the-NULL.patch --]
[-- Type: text/plain, Size: 919 bytes --]

From: Dan Carpenter <error27@gmail.com>

We need to add one to the strlen() return because of the NULL
character.  The type->name here generally comes from the kernel and I
don't think any of them come close to being MAX_TRACER_SIZE (100)
characters long so this is basically a cleanup.

Signed-off-by: Dan Carpenter <error27@gmail.com>
LKML-Reference: <20100710100644.GV19184@bicker>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f7488f4..cacb6f0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -739,7 +739,7 @@ __acquires(kernel_lock)
 		return -1;
 	}
 
-	if (strlen(type->name) > MAX_TRACER_SIZE) {
+	if (strlen(type->name) >= MAX_TRACER_SIZE) {
 		pr_info("Tracer has a name longer than %d\n", MAX_TRACER_SIZE);
 		return -1;
 	}
-- 
1.7.1



  parent reply	other threads:[~2010-07-22 20:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 20:24 [PATCH 0/7] [GIT PULL] tracing: updates Steven Rostedt
2010-07-22 20:24 ` [PATCH 1/7] tracing: Allow to disable cmdline recording Steven Rostedt
2010-07-22 20:24 ` [PATCH 2/7] trace: Reorder struct ring_buffer_per_cpu to remove padding on 64bit Steven Rostedt
2010-07-22 20:24 ` [PATCH 3/7] tracing: Reduce latency and remove percpu trace_seq Steven Rostedt
2010-07-22 20:24 ` [PATCH 4/7] tracing: Shrink max latency ringbuffer if unnecessary Steven Rostedt
2010-07-22 20:24 ` [PATCH 5/7] tracing/documentation: Document dynamic ftracer internals Steven Rostedt
2010-07-22 20:24 ` [PATCH 6/7] tracing: Fix $mcount_regex for MIPS in recordmcount.pl Steven Rostedt
2010-07-22 20:24 ` Steven Rostedt [this message]
2010-07-23  7:12 ` [PATCH 0/7] [GIT PULL] tracing: updates 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=20100722202453.766121554@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=error27@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

Powered by JetHome