]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: ufs: Fix illegal offset in UPIU event trace
authorJonathan Hsu <jonathan.hsu@mediatek.com>
Fri, 24 Sep 2021 08:58:48 +0000 (16:58 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 29 Sep 2021 02:37:40 +0000 (22:37 -0400)
Fix incorrect index for UTMRD reference in ufshcd_add_tm_upiu_trace().

Link: https://lore.kernel.org/r/20210924085848.25500-1-jonathan.hsu@mediatek.com
Fixes: 18115bc29147 ("scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs")
Cc: stable@vger.kernel.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jonathan Hsu <jonathan.hsu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index 029c9631ec2bf00ae252c5ae42e134bf3e53fe12..188de6f9105000dc69af6e48bc0a24624b5cc0ce 100644 (file)
@@ -318,8 +318,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;