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.c...@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
_______________________________________________
Uclinux-dist-devel mailing list
Uclinux-dist-devel@blackfin.uclinux.org
https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel

Reply via email to