From: Tomas Henzl Date: Wed, 23 Dec 2015 13:21:47 +0000 (+0100) Subject: mpt3sas: A correction in unmap_resources X-Git-Tag: firefly_0821_release~176^2~4^2~31^2~124 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8b208a5d0a3b37a68cb1694a125c8deee56be45c;p=firefly-linux-kernel-4.4.55.git mpt3sas: A correction in unmap_resources [ Upstream commit 5f985d88bac34e7f3b4403118eab072902a0b392 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 356233f86064..9137ae2b841f 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);