@@ -228,6 +228,8 @@ static void qla_nvme_abort_work(struct work_struct *work)
228
228
fc_port_t * fcport = sp -> fcport ;
229
229
struct qla_hw_data * ha = fcport -> vha -> hw ;
230
230
int rval , abts_done_called = 1 ;
231
+ bool io_wait_for_abort_done ;
232
+ uint32_t handle ;
231
233
232
234
ql_dbg (ql_dbg_io , fcport -> vha , 0xffff ,
233
235
"%s called for sp=%p, hndl=%x on fcport=%p desc=%p deleted=%d\n" ,
@@ -244,12 +246,20 @@ static void qla_nvme_abort_work(struct work_struct *work)
244
246
goto out ;
245
247
}
246
248
249
+ /*
250
+ * sp may not be valid after abort_command if return code is either
251
+ * SUCCESS or ERR_FROM_FW codes, so cache the value here.
252
+ */
253
+ io_wait_for_abort_done = ql2xabts_wait_nvme &&
254
+ QLA_ABTS_WAIT_ENABLED (sp );
255
+ handle = sp -> handle ;
256
+
247
257
rval = ha -> isp_ops -> abort_command (sp );
248
258
249
259
ql_dbg (ql_dbg_io , fcport -> vha , 0x212b ,
250
260
"%s: %s command for sp=%p, handle=%x on fcport=%p rval=%x\n" ,
251
261
__func__ , (rval != QLA_SUCCESS ) ? "Failed to abort" : "Aborted" ,
252
- sp , sp -> handle , fcport , rval );
262
+ sp , handle , fcport , rval );
253
263
254
264
/*
255
265
* If async tmf is enabled, the abort callback is called only on
@@ -264,7 +274,7 @@ static void qla_nvme_abort_work(struct work_struct *work)
264
274
* are waited until ABTS complete. This kref is decreased
265
275
* at qla24xx_abort_sp_done function.
266
276
*/
267
- if (abts_done_called && ql2xabts_wait_nvme && QLA_ABTS_WAIT_ENABLED ( sp ) )
277
+ if (abts_done_called && io_wait_for_abort_done )
268
278
return ;
269
279
out :
270
280
/* kref_get was done before work was schedule. */
0 commit comments