Patch "s390/dasd: Fix potential memleak in dasd_eckd_init()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    s390/dasd: Fix potential memleak in dasd_eckd_init()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     s390-dasd-fix-potential-memleak-in-dasd_eckd_init.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b37578f92e27e439e623cde658ebd75863b7b4df
Author: Qiheng Lin <linqiheng@xxxxxxxxxx>
Date:   Fri Feb 10 01:02:53 2023 +0100

    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: 9e12e54c7a8f ("s390/dasd: Handle out-of-space constraint")
    Signed-off-by: Qiheng Lin <linqiheng@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221208133809.16796-1-linqiheng@xxxxxxxxxx
    Signed-off-by: Stefan Haberland <sth@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230210000253.1644903-3-sth@xxxxxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index d1429936f38c6..c6930c159d2a6 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -6763,8 +6763,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) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux