diff mbox

mpt3sas: a correction in unmap_resources

Message ID 1450876907-3913-1-git-send-email-thenzl@redhat.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Tomas Henzl Dec. 23, 2015, 1:21 p.m. UTC
It might happen that we try to free an already freed pointer.

Tomas

Reported-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Martin K. Petersen Jan. 5, 2016, 2:01 a.m. UTC | #1
>>>>> "Tomas" == Tomas Henzl <thenzl@redhat.com> writes:

Tomas> It might happen that we try to free an already freed pointer.
Tomas> Tomas

Applied to 4.5/scsi-queue.
diff mbox

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index d4f1dcdb83..3b09b3d09f 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1827,8 +1827,10 @@  mpt3sas_base_unmap_resources(struct MPT3SAS_ADAPTER *ioc)
 	_base_free_irq(ioc);
 	_base_disable_msix(ioc);
 
-	if (ioc->msix96_vector)
+	if (ioc->msix96_vector) {
 		kfree(ioc->replyPostRegisterIndex);
+		ioc->replyPostRegisterIndex = NULL;
+	}
 
 	if (ioc->chip_phys) {
 		iounmap(ioc->chip);