Skip to content

Commit

Permalink
scsi: qla2xxx: Fix panic from use after free in qla2x00_async_tm_cmd
Browse files Browse the repository at this point in the history
In qla2x00_async_tm_cmd, we reference off sp after it has been freed.  This
caused a panic on a system running a slub debug kernel. Since fcport is
passed in anyways, just use that instead.

Signed-off-by: Bill Kuzeja <william.kuzeja@stratus.com>
Acked-by: Giridhar Malavali <gmalavali@marvell.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Bill Kuzeja authored and Martin K. Petersen committed Feb 13, 2019
1 parent e4a0569 commit 388a499
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1785,13 +1785,13 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun,

/* Issue Marker IOCB */
qla2x00_marker(vha, vha->hw->req_q_map[0],
vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun,
vha->hw->rsp_q_map[0], fcport->loop_id, lun,
flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID);
}

done_free_sp:
sp->free(sp);
sp->fcport->flags &= ~FCF_ASYNC_SENT;
fcport->flags &= ~FCF_ASYNC_SENT;
done:
return rval;
}
Expand Down

0 comments on commit 388a499

Please sign in to comment.