]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:52 +0000 (14:06 +0200)
commitfe61765d8642370d892cb681560e4d317c75bed2
tree2f60ed9c8ef9456a159fa4e531c2773bc7ef1e2c
parent8473e4929218e5df852712010217305e745401e2
proc: bootconfig: Add null pointer check

commit bed5b60bf67ccd8957b8c0558fead30c4a3f5d3f upstream.

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: c1a3c36017d4 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/proc/bootconfig.c