Commit 421cc3e7 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

Revert "megasas: remove useless check for cmd->frame"



This reverts commit 8cc46787.
It turns out that cmd->frame can be NULL and thus the commit
can cause a SIGSEGV

Reported-by: default avatarHolger Schranz <holger@fam-schranz.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 90f998f5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1981,7 +1981,11 @@ static void megasas_handle_frame(MegasasState *s, uint64_t frame_addr,
        break;
    }
    if (frame_status != MFI_STAT_INVALID_STATUS) {
        if (cmd->frame) {
            cmd->frame->header.cmd_status = frame_status;
        } else {
            megasas_frame_set_cmd_status(s, frame_addr, frame_status);
        }
        megasas_unmap_frame(s, cmd);
        megasas_complete_frame(s, cmd->context);
    }