Patch "scsi: hpsa: Fix memory leak in hpsa_init_one()" has been added to the 4.9-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

    scsi: hpsa: Fix memory leak in hpsa_init_one()

to the 4.9-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:
     scsi-hpsa-fix-memory-leak-in-hpsa_init_one.patch
and it can be found in the queue-4.9 subdirectory.

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



commit 50be43790f13fcc83bca8a9f9e59f44fb1fd4af2
Author: Keita Suzuki <keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx>
Date:   Tue Oct 27 07:31:24 2020 +0000

    scsi: hpsa: Fix memory leak in hpsa_init_one()
    
    [ Upstream commit af61bc1e33d2c0ec22612b46050f5b58ac56a962 ]
    
    When hpsa_scsi_add_host() fails, h->lastlogicals is leaked since it is
    missing a free() in the error handler.
    
    Fix this by adding free() when hpsa_scsi_add_host() fails.
    
    Link: https://lore.kernel.org/r/20201027073125.14229-1-keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx
    Tested-by: Don Brace <don.brace@xxxxxxxxxxxxx>
    Acked-by: Don Brace <don.brace@xxxxxxxxxxxxx>
    Signed-off-by: Keita Suzuki <keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index b82df8cdf9626..7f1d6d52d48bd 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -8937,7 +8937,7 @@ reinit_after_soft_reset:
 	/* hook into SCSI subsystem */
 	rc = hpsa_scsi_add_host(h);
 	if (rc)
-		goto clean7; /* perf, sg, cmd, irq, shost, pci, lu, aer/h */
+		goto clean8; /* lastlogicals, perf, sg, cmd, irq, shost, pci, lu, aer/h */
 
 	/* Monitor the controller for firmware lockups */
 	h->heartbeat_sample_interval = HEARTBEAT_SAMPLE_INTERVAL;
@@ -8949,6 +8949,8 @@ reinit_after_soft_reset:
 				h->heartbeat_sample_interval);
 	return 0;
 
+clean8: /* lastlogicals, perf, sg, cmd, irq, shost, pci, lu, aer/h */
+	kfree(h->lastlogicals);
 clean7: /* perf, sg, cmd, irq, shost, pci, lu, aer/h */
 	hpsa_free_performant_mode(h);
 	h->access.set_intr_mask(h, HPSA_INTR_OFF);



[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