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)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:18:08 +0000 (17:18 +0100)
commitad9bb8f049717d64c5e62b2a44954be9f681c65b
treee8d86c4394e64f0bcab9327b1436862e004d7ffc
parent3db42c75a921854a99db0a2775814fef97415bac
s390/tty: Fix a potential memory leak bug

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>
drivers/s390/char/sclp_tty.c