* [PATCH v1] s390/dasd: Fix memory leak in FBA driver initialization
@ 2026-10-14 14:21 Volkan Unal
2026-10-14 14:27 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Volkan Unal @ 2026-10-14 14:21 UTC (permalink / raw)
To: linux-s390
Fix memory leak in dasd_fba_init() where the allocated zero page
is not freed if ccw_driver_register() fails.
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Volkan Unal <vunal@linux.ibm.com>
---
drivers/s390/block/dasd_fba.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 3f56b353b868..3b8d15e9a2de 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -804,10 +804,13 @@ dasd_fba_init(void)
return -ENOMEM;
ret = ccw_driver_register(&dasd_fba_driver);
- if (!ret)
- wait_for_device_probe();
+ if (ret) {
+ free_page((unsigned long)dasd_fba_zero_page);
+ return ret;
+ }
- return ret;
+ wait_for_device_probe();
+ return 0;
}
static void __exit
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-14 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 14:21 [PATCH v1] s390/dasd: Fix memory leak in FBA driver initialization Volkan Unal
2026-10-14 14:27 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox