projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a00cf36
)
s390/dasd: Fix potential memleak in dasd_eckd_init()
author
Qiheng Lin
<linqiheng@huawei.com>
Fri, 10 Feb 2023 00:02:53 +0000
(
01:02
+0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:04 +0000
(09:39 +0100)
[ 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: 9e12e54c7a8f ("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
patch
|
blob
|
history
diff --git
a/drivers/s390/block/dasd_eckd.c
b/drivers/s390/block/dasd_eckd.c
index 57dfc92aa756f345d36667f57844280e9b64da4b..56ab74aa07f42c4ff8b590f7c043d2a03fd74b1e 100644
(file)
--- a/
drivers/s390/block/dasd_eckd.c
+++ b/
drivers/s390/block/dasd_eckd.c
@@
-6729,8
+6729,10
@@
dasd_eckd_init(void)
return -ENOMEM;
dasd_vol_info_req = kmalloc(sizeof(*dasd_vol_info_req),
GFP_KERNEL | GFP_DMA);
- if (!dasd_vol_info_req)
+ if (!dasd_vol_info_req) {
+ kfree(dasd_reserve_req);
return -ENOMEM;
+ }
pe_handler_worker = kmalloc(sizeof(*pe_handler_worker),
GFP_KERNEL | GFP_DMA);
if (!pe_handler_worker) {