From: Tomas Henzl Date: Wed, 23 Dec 2015 13:21:47 +0000 (+0100) Subject: mpt3sas: A correction in unmap_resources X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f985d88bac34e7f3b4403118eab072902a0b392;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mpt3sas: A correction in unmap_resources It might happen that we try to free an already freed pointer. Reported-by: Maurizio Lombardi Signed-off-by: Tomas Henzl Acked-by: Chaitra P B Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 11393ebf1a68..83658acddd58 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -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);