]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/sclp: Add check for get_zeroed_page()
authorHaoxiang Li <haoxiang_li2024@163.com>
Tue, 18 Feb 2025 02:52:16 +0000 (10:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:34 +0000 (07:44 +0200)
commite1e00dc45648125ef7cb87ebc3b581ac224e7b39
tree4c15aaa1c00f8f39c0f33e90501d32c6c6d75696
parent6992fb10dff2ce4582e320e616a1cba247d19370
s390/sclp: Add check for get_zeroed_page()

[ Upstream commit 3db42c75a921854a99db0a2775814fef97415bac ]

Add check for the return value of get_zeroed_page() in
sclp_console_init() to prevent null pointer dereference.
Furthermore, to solve the memory leak caused by the loop
allocation, add a free helper to do the free job.

Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250218025216.2421548-1-haoxiang_li2024@163.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/char/sclp_con.c