]> git.baikalelectronics.ru Git - kernel.git/commit
s390/dasd: Fix potential memleak in dasd_eckd_init()
authorQiheng Lin <linqiheng@huawei.com>
Fri, 10 Feb 2023 00:02:53 +0000 (01:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:35 +0000 (16:43 +0100)
commit03220f67c49a91c9859287b993658afb2adc5bfc
tree3ce5bf5daad9b72329cedeba67c02e3e9fdc9ab5
parente8298c2fa473b3c2f077e8763aabe19c5989aa42
s390/dasd: Fix potential memleak in dasd_eckd_init()

[ Upstream commit 460e9bed82e49db1b823dcb4e421783854d86c40 ]

`dasd_reserve_req` is allocated before `dasd_vol_info_req`, and it
also needs to be freed before the error returns, just like the other
cases in this function.

Fixes: 7ef9325cac2e ("s390/dasd: Handle out-of-space constraint")
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20221208133809.16796-1-linqiheng@huawei.com
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20230210000253.1644903-3-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/block/dasd_eckd.c