Re: [PATCH 08/15] megaraid_sas: Use SMID for Task abort case only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/30/2017 10:30 AM, Shivasharan S wrote:
> Fix - In TM code, smid_task is valid only in case of task aborts.
> 
> Signed-off-by: Kashyap Desai <kashyap.desai@xxxxxxxxxxxx>
> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@xxxxxxxxxxxx>
> ---
>  drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index a308e14..c239762 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -3754,7 +3754,7 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
>  	struct megasas_cmd_fusion *cmd_fusion;
>  	struct megasas_cmd *cmd_mfi;
>  	union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc;
> -	struct fusion_context *fusion;
> +	struct fusion_context *fusion = NULL;
>  	struct megasas_cmd_fusion *scsi_lookup;
>  	int rc;
>  	struct MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply;
> @@ -3781,8 +3781,6 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
>  	cmd_fusion->request_desc = req_desc;
>  	req_desc->Words = 0;
>  
> -	scsi_lookup = fusion->cmd_list[smid_task - 1];
> -
>  	mr_request = (struct MR_TASK_MANAGE_REQUEST *) cmd_fusion->io_request;
>  	memset(mr_request, 0, sizeof(struct MR_TASK_MANAGE_REQUEST));
>  	mpi_request = (struct MPI2_SCSI_TASK_MANAGE_REQUEST *) &mr_request->TmRequest;
> @@ -3829,6 +3827,8 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
>  	rc = SUCCESS;
>  	switch (type) {
>  	case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK:
> +		scsi_lookup = fusion->cmd_list[smid_task - 1];
> +
>  		if (scsi_lookup->scmd == NULL)
>  			break;
>  		else {
> 
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux