From: Chen Gang <gang.chen@asianux.com>
To: Mike Frysinger <vapier@gentoo.org>,
anton.vorontsov@linaro.org, Richard Kuo <rkuo@codeaurora.org>,
jesper.nilsson@axis.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>,
"uclinux-dist-devel@blackfin.uclinux.org"
<uclinux-dist-devel@blackfin.uclinux.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>
Subject: [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s'
Date: Wed, 29 May 2013 17:43:16 +0800 [thread overview]
Message-ID: <51A5CDB4.9000204@asianux.com> (raw)
When it is kernel symbol, the 'modname' will be NUL, and the 'symname'
contents the valid name.
So for sprintf(), need avoid NUL for '%s'.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
arch/blackfin/kernel/trace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c
index c36efa0..11f98bb 100644
--- a/arch/blackfin/kernel/trace.c
+++ b/arch/blackfin/kernel/trace.c
@@ -51,7 +51,7 @@ void decode_address(char *buf, unsigned long address)
if (!modname)
modname = delim = "";
sprintf(buf, "{ %s%s%s%s + 0x%lx }",
- delim, modname, delim, symname,
+ delim, modname ? : "kernel", delim, symname,
(unsigned long)offset);
return;
}
--
1.7.7.6
next reply other threads:[~2013-05-29 9:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 9:43 Chen Gang [this message]
2013-05-29 9:43 ` [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s' Chen Gang
2013-05-29 10:07 ` [PATCH] arch: blackfin: kernel: memory overflow, 'namebuf' length need be more than 256 Chen Gang
2013-05-29 11:30 ` Geert Uytterhoeven
2013-05-29 12:06 ` Chen Gang
2013-06-16 3:02 ` [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s' Mike Frysinger
2013-06-16 3:02 ` Mike Frysinger
2013-06-17 1:13 ` Chen Gang
2013-06-17 1:13 ` Chen Gang
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=51A5CDB4.9000204@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=anton.vorontsov@linaro.org \
--cc=davem@davemloft.net \
--cc=jesper.nilsson@axis.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkuo@codeaurora.org \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
--cc=vapier@gentoo.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