From 0f4c4e2dca4ebda5c956a683b02db7749e2e4e75 Mon Sep 17 00:00:00 2001 From: Helen Zeng Date: Thu, 29 Sep 2011 14:25:43 -0700 Subject: [PATCH] ASoC: msm: qdsp6: Print message only when string is not NULL Solve the crash which may be caused by NULL name in voc_get_session_id function. CRs-fixed: 310289 Signed-off-by: Helen Zeng --- sound/soc/msm/qdsp6/q6voice.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/msm/qdsp6/q6voice.c b/sound/soc/msm/qdsp6/q6voice.c index b287c70fc79..ecfef5b6de8 100644 --- a/sound/soc/msm/qdsp6/q6voice.c +++ b/sound/soc/msm/qdsp6/q6voice.c @@ -137,9 +137,10 @@ uint16_t voc_get_session_id(char *name) session_id = common.voice[VOC_PATH_PASSIVE].session_id; else session_id = common.voice[VOC_PATH_FULL].session_id; - } - pr_debug("%s: %s has session id 0x%x\n", __func__, name, session_id); + pr_debug("%s: %s has session id 0x%x\n", __func__, name, + session_id); + } return session_id; }