[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210315135511.924863168@linuxfoundation.org>
Date: Mon, 15 Mar 2021 14:53:09 +0100
From: gregkh@...uxfoundation.org
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Jack Wang <jinpu.wang@...ud.ionos.com>,
akshatzen <akshatzen@...gle.com>,
Viswas G <Viswas.G@...rochip.com>,
Ruksar Devadi <Ruksar.devadi@...rochip.com>,
Radha Ramachandran <radha@...gle.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.11 126/306] scsi: pm80xx: Fix missing tag_free in NVMD DATA req
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
From: akshatzen <akshatzen@...gle.com>
[ Upstream commit 5d28026891c7041deec08cc5ddd8f3abd90195e1 ]
Tag was not freed in NVMD get/set data request failure scenario. This
caused a tag leak each time a request failed.
Link: https://lore.kernel.org/r/20210109123849.17098-5-Viswas.G@microchip.com
Acked-by: Jack Wang <jinpu.wang@...ud.ionos.com>
Signed-off-by: akshatzen <akshatzen@...gle.com>
Signed-off-by: Viswas G <Viswas.G@...rochip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@...rochip.com>
Signed-off-by: Radha Ramachandran <radha@...gle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index dd15246d5b03..ea43dff40a85 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -3038,8 +3038,8 @@ void pm8001_mpi_set_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
complete(pm8001_ha->nvmd_completion);
pm8001_dbg(pm8001_ha, MSG, "Set nvm data complete!\n");
if ((dlen_status & NVMD_STAT) != 0) {
- pm8001_dbg(pm8001_ha, FAIL, "Set nvm data error!\n");
- return;
+ pm8001_dbg(pm8001_ha, FAIL, "Set nvm data error %x\n",
+ dlen_status);
}
ccb->task = NULL;
ccb->ccb_tag = 0xFFFFFFFF;
@@ -3062,11 +3062,17 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
pm8001_dbg(pm8001_ha, MSG, "Get nvm data complete!\n");
if ((dlen_status & NVMD_STAT) != 0) {
- pm8001_dbg(pm8001_ha, FAIL, "Get nvm data error!\n");
+ pm8001_dbg(pm8001_ha, FAIL, "Get nvm data error %x\n",
+ dlen_status);
complete(pm8001_ha->nvmd_completion);
+ /* We should free tag during failure also, the tag is not being
+ * freed by requesting path anywhere.
+ */
+ ccb->task = NULL;
+ ccb->ccb_tag = 0xFFFFFFFF;
+ pm8001_tag_free(pm8001_ha, tag);
return;
}
-
if (ir_tds_bn_dps_das_nvm & IPMode) {
/* indirect mode - IR bit set */
pm8001_dbg(pm8001_ha, MSG, "Get NVMD success, IR=1\n");
--
2.30.1
Powered by blists - more mailing lists