Skip to content

Commit

Permalink
[SCSI] be2iscsi: fix null ptr when accessing task hdr
Browse files Browse the repository at this point in the history
If alloc_pdu fails then the task->hdr pointer may not be
set. This adds a check for this case in the cleanup callback.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Mike Christie authored and James Bottomley committed Dec 31, 2010
1 parent bc7acce commit 1227633
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/be2iscsi/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,8 @@ static void beiscsi_cleanup_task(struct iscsi_task *task)
io_task->psgl_handle = NULL;
}
} else {
if ((task->hdr->opcode & ISCSI_OPCODE_MASK) == ISCSI_OP_LOGIN)
if (task->hdr &&
((task->hdr->opcode & ISCSI_OPCODE_MASK) == ISCSI_OP_LOGIN))
return;
if (io_task->psgl_handle) {
spin_lock(&phba->mgmt_sgl_lock);
Expand Down

0 comments on commit 1227633

Please sign in to comment.