On 02/17/2017 09:35 AM, Christoph Hellwig wrote: > 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? > The check for that is being added in path 09/11; should've moved it to here. 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)