[SCSI] be2iscsi: fix null ptr when accessing task hdr
[pandora-kernel.git] / drivers / scsi / be2iscsi / be_main.c
index be07ca0..79cefbe 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);