diff mbox series

[-next] advansys: use correct srb_tag in adv_isr_callback

Message ID 20180926114107.13532-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Headers show
Series [-next] advansys: use correct srb_tag in adv_isr_callback | expand

Commit Message

Yue Haibing Sept. 26, 2018, 11:41 a.m. UTC
'srb_tag' should be used in the scsi_host_find_tag,
rather than 'scsiqp->srb_tag'.

Fixes: 9c17c62aedb0 ("advansys: use shared host tag map for command lookup")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/advansys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen Oct. 17, 2018, 1:34 a.m. UTC | #1
Hi Yue Haibing,

>  	srb_tag = le32_to_cpu(scsiqp->srb_tag);
> -	scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
> +	scp = scsi_host_find_tag(boardp->shost, srb_tag);

Maybe I'm missing something, but I don't see where in the code
scsiqp->srb_tag is being converted to le32. srb_tag is beyond the memory
accessed by the controller and thus wouldn't need to be little endian.
Yue Haibing Oct. 17, 2018, 12:03 p.m. UTC | #2
On 2018/10/17 9:34, Martin K. Petersen wrote:
> 
> Hi Yue Haibing,
> 
>>  	srb_tag = le32_to_cpu(scsiqp->srb_tag);
>> -	scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
>> +	scp = scsi_host_find_tag(boardp->shost, srb_tag);
> 
> Maybe I'm missing something, but I don't see where in the code
> scsiqp->srb_tag is being converted to le32. srb_tag is beyond the memory
> accessed by the controller and thus wouldn't need to be little endian.

Thanks for comment this.

So 'srb_tag' can been removed.

>
diff mbox series

Patch

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 713f690..23f313c 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -5966,7 +5966,7 @@  static void adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
 	 * completed ADV_SCSI_REQ_Q structure.
 	 */
 	srb_tag = le32_to_cpu(scsiqp->srb_tag);
-	scp = scsi_host_find_tag(boardp->shost, scsiqp->srb_tag);
+	scp = scsi_host_find_tag(boardp->shost, srb_tag);
 
 	ASC_DBG(1, "scp 0x%p\n", scp);
 	if (scp == NULL) {