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") Cc: stable@vger.kernel.org Signed-off-by: Jonathan Hsu jonathan.hsu@mediatek.com --- drivers/scsi/ufs/ufshcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3841ab49f556..36aa27cdc2ab 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -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;
On Fri, 2021-09-24 at 16:58 +0800, Jonathan Hsu wrote:
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") Cc: stable@vger.kernel.org Signed-off-by: Jonathan Hsu jonathan.hsu@mediatek.com
Reviewed-by: Stanley Chu stanley.chu@mediatek.com
On 9/24/21 1:58 AM, Jonathan Hsu wrote:
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") Cc: stable@vger.kernel.org Signed-off-by: Jonathan Hsu jonathan.hsu@mediatek.com
Reviewed-by: Bart Van Assche bvanassche@acm.org
On Fri, 24 Sep 2021 16:58:48 +0800, Jonathan Hsu wrote:
Fix incorrect index for UTMRD reference in ufshcd_add_tm_upiu_trace().
Applied to 5.15/scsi-fixes, thanks!
[1/1] scsi: ufs: Fix illegal address reading in upiu event trace https://git.kernel.org/mkp/scsi/c/e8c2da7e329c
linux-stable-mirror@lists.linaro.org