]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/tty: Fix a potential memory leak bug
authorHaoxiang Li <haoxiang_li2024@163.com>
Tue, 18 Feb 2025 03:41:04 +0000 (11:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:34 +0000 (07:44 +0200)
commitd9ef9664e44ea3e54878ca19aec1bc350b5d2057
tree499cbfc93b88f6a8eb45a22a1e4d8fd7ddeaf564
parente1e00dc45648125ef7cb87ebc3b581ac224e7b39
s390/tty: Fix a potential memory leak bug

[ Upstream commit ad9bb8f049717d64c5e62b2a44954be9f681c65b ]

The check for get_zeroed_page() leads to a direct return
and overlooked the memory leak caused by loop allocation.
Add a free helper to free spaces allocated by get_zeroed_page().

Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250218034104.2436469-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_tty.c