public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s'
@ 2013-05-29  9:43 Chen Gang
  2013-05-29  9:43 ` Chen Gang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chen Gang @ 2013-05-29  9:43 UTC (permalink / raw)
  To: Mike Frysinger, anton.vorontsov, Richard Kuo, jesper.nilsson
  Cc: Andrew Morton, David Miller,
	uclinux-dist-devel@blackfin.uclinux.org,
	linux-kernel@vger.kernel.org, Linux-Arch


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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-17  1:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-29  9:43 [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s' Chen Gang
2013-05-29  9:43 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox