mpt3sas: A correction in unmap_resources
authorTomas Henzl <thenzl@redhat.com>
Wed, 23 Dec 2015 13:21:47 +0000 (14:21 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 6 Jan 2016 20:10:37 +0000 (15:10 -0500)
It might happen that we try to free an already freed pointer.

Reported-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: Chaitra P B <chaitra.basappa@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c

index 11393ebf1a68ef8f14a38d58f1321d7783a84d72..83658acddd584bfcd0c5eb5545648d021e3e65f1 100644 (file)
@@ -2020,8 +2020,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);