]> git.baikalelectronics.ru Git - kernel.git/commit
proc: bootconfig: Add null pointer check
authorLv Ruyi <lv.ruyi@zte.com.cn>
Tue, 29 Mar 2022 10:40:04 +0000 (10:40 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 2 Apr 2022 12:40:09 +0000 (08:40 -0400)
commit8d84d690f6e30c4b4ef5cb3f04ab988a9069e3e1
treec446bf231deeaa6a80c29fe4fe3dbfbe0ab37090
parent40df97dafa23f7c1863a6a3577f84b8096fcfc36
proc: bootconfig: Add null pointer check

kzalloc is a memory allocation function which can return NULL when some
internal memory errors happen. It is safer to add null pointer check.

Link: https://lkml.kernel.org/r/20220329104004.2376879-1-lv.ruyi@zte.com.cn
Cc: stable@vger.kernel.org
Fixes: 9d52ced8893c ("proc: bootconfig: Add /proc/bootconfig to show boot config list")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/proc/bootconfig.c