ASoC: SOF: debug: Fix a potential issue on string buffer termination
authorHui Wang <hui.wang@canonical.com>
Mon, 8 Feb 2021 10:38:57 +0000 (18:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:47 +0000 (11:37 +0100)
commit79717a3381dd650df27dde183934d32658f31f9d
treee6b43c860da24a72f4317a2fab9b4cb3ba8e4f94
parent47d35964886f83ae104a7b319ee25341ef086ef2
ASoC: SOF: debug: Fix a potential issue on string buffer termination

[ Upstream commit 9037c3bde65d339017ef41d81cb58069ffc321d4 ]

The function simple_write_to_buffer() doesn't add string termination
at the end of buf, we need to handle it on our own. This change refers
to the function tokenize_input() in debug.c and the function
sof_dfsentry_trace_filter_write() in trace.c.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20210208103857.75705-1-hui.wang@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/sof/debug.c