]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[SCSI] be2iscsi: fix null ptr when accessing task hdr
authorMike Christie <michaelc@cs.wisc.edu>
Fri, 31 Dec 2010 08:22:20 +0000 (02:22 -0600)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 31 Dec 2010 15:52:42 +0000 (09:52 -0600)
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>
drivers/scsi/be2iscsi/be_main.c

index be07ca06177eba64a1b7bfca4cfbd2131ce01a39..79cefbe31367cb5a1823907ff9266b7da96cedf5 100644 (file)
@@ -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);