Re: [PATCHv2 07/11] mpt3sas: check command status before attempting abort

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

 



On Fri, Feb 17, 2017 at 09:23:06AM +0100, Hannes Reinecke wrote:
> When attempting a command abort we should check the command status
> prior to sending the abort; the command might've been completed
> already.
> 
> Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
> ---
>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index a88f2ac..989cdc8 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -2261,6 +2261,12 @@ struct _sas_node *
>  		return (!rc) ? SUCCESS : FAILED;
>  	}
>  
> +	if (type == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) {
> +		scsi_lookup = mpt3sas_get_st_from_smid(ioc, smid_task);
> +		if (scsi_lookup->cb_idx == 0xFF)
> +			return SUCCESS;
> +	}

Not really new in this patch, but I'm worried that we don't check for
a NULL return here.  Are we 100% sure no invalid smid can be passed in?

But the patch itself looks fine:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[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