diff mbox

mpt3sas: a correction in unmap_resources

Message ID b29633fa704eab7219d60014ebc17cd9@mail.gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Chaitra Basappa Jan. 4, 2016, 11:21 a.m. UTC
Hi,
 Please consider this patch as Ack-by: Chaitra P B
<chaitra.basappa@avagotech.com>

Thanks,
 Chaitra

-----Original Message-----
From: Tomas Henzl [mailto:thenzl@redhat.com]
Sent: Wednesday, December 23, 2015 6:52 PM
To: linux-scsi@vger.kernel.org
Cc: kashyap.desai@avagotech.com; chaitra.basappa@avagotech.com;
mlombard@redhat.com
Subject: [PATCH] mpt3sas: a correction in unmap_resources

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(-)

 		iounmap(ioc->chip);
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) {