tracing/uprobes: Check the return value of kstrdup() for tu->filename
authorXiaoke Wang <xkernel.wang@foxmail.com>
Tue, 14 Dec 2021 01:28:02 +0000 (09:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:38 +0000 (19:12 +0100)
commit8a20fed48eb48bd3ef7d5649b3e9aeb038a79673
tree90b651a2b547443630b5688f7aebe5e91598b732
parent1a62246c2c600e4b5dabe1a5794c6d0bf5a860b5
tracing/uprobes: Check the return value of kstrdup() for tu->filename

[ Upstream commit 8c7224245557707c613f130431cafbaaa4889615 ]

kstrdup() returns NULL when some internal memory errors happen, it is
better to check the return value of it so to catch the memory error in
time.

Link: https://lkml.kernel.org/r/tencent_3C2E330722056D7891D2C83F29C802734B06@qq.com
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 33ea4b24277b ("perf/core: Implement the 'perf_uprobe' PMU")
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace_uprobe.c