Skip to content

Commit

Permalink
scsi: qedi: Fix null ref during abort handling
Browse files Browse the repository at this point in the history
If qedi_process_cmd_cleanup_resp finds the cmd it frees the work and sets
list_tmf_work to NULL, so qedi_tmf_work should check if list_tmf_work is
non-NULL when it wants to force cleanup.

Link: https://lore.kernel.org/r/20210525181821.7617-20-michael.christie@oracle.com
Reviewed-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Mike Christie authored and Martin K. Petersen committed Jun 2, 2021
1 parent a1f3486 commit 5777b7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/qedi/qedi_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ static void qedi_tmf_work(struct work_struct *work)

ldel_exit:
spin_lock_bh(&qedi_conn->tmf_work_lock);
if (!qedi_cmd->list_tmf_work) {
if (qedi_cmd->list_tmf_work) {
list_del_init(&list_work->list);
qedi_cmd->list_tmf_work = NULL;
kfree(list_work);
Expand Down

0 comments on commit 5777b7f

Please sign in to comment.