Skip to contentSkip to conversation

scsi: ufs: Fix illegal address reading in upiu event trace

PATCH Superseded Jonathan Hsu 2 participants 2 messages Sep 24, 2021

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: Fix illegal address reading in upiu event trace

Fix incorrect index for UTMRD reference in ufshcd_add_tm_upiu_trace().

Fixes 4b42d557a8ad ("scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs")
Change-Id I9acab6f3223f96d864948bb5670759d58cf92ad6
---
 drivers/scsi/ufs/ufshcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -2
index 3841ab49f556..36aa27cdc2ab 100644
@@ -319,8 +319,7 @@ static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba,
 static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag,
 				     enum ufs_trace_str_t str_t)
 {
-	int off = (int)tag - hba->nutrs;
-	struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[off];
+	struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[tag];
 
 	if (!trace_ufshcd_upiu_enabled())
 		return;
Signature · 1 line
2.18.0
maintainer
#1 lore raw
Quoted 8 lines · Jonathan Hsu

Fix incorrect index for UTMRD reference in ufshcd_add_tm_upiu_trace().

Fixes 4b42d557a8ad ("scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs")
Change-Id I9acab6f3223f96d864948bb5670759d58cf92ad6
---
 drivers/scsi/ufs/ufshcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

Also, always run checkpatch.pl on your patches, it will show you that the "Change-Id" field is not valid here.

thanks,

greg k-h