mpt3sas: A correction in unmap_resources
authorTomas Henzl <thenzl@redhat.com>
Wed, 23 Dec 2015 13:21:47 +0000 (14:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:43 +0000 (08:27 +0200)
[ Upstream commit 5f985d88bac34e7f3b4403118eab072902a0b392 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/mpt3sas/mpt3sas_base.c

index 356233f8606420faabf496f3c1099af2079924b3..9137ae2b841f8177d8971f025f3310e15e5c21c0 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);