diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-09-08 17:42:53 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2016-12-12 18:15:33 -0600 |
commit | db1604cd60f1736098eec4feba099b9bd885b8ed (patch) | |
tree | 8bd0afff81f94fb73934620d5b5376e581000b83 | |
parent | cc1fd252953405342491d93f3dc4406c8a6296fb (diff) | |
download | qemu-db1604cd60f1736098eec4feba099b9bd885b8ed.tar.gz |
Revert "megasas: remove useless check for cmd->frame"
This reverts commit 8cc46787b5b58f01a11c919c7ff939ed009e27fc.
It turns out that cmd->frame can be NULL and thus the commit
can cause a SIGSEGV
Reported-by: Holger Schranz <holger@fam-schranz.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 421cc3e7e89cb807d3c5f6de486abb2167c8e792)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | hw/scsi/megasas.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index e968302fdc..52a41239cf 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -1981,7 +1981,11 @@ static void megasas_handle_frame(MegasasState *s, uint64_t frame_addr, break; } if (frame_status != MFI_STAT_INVALID_STATUS) { - cmd->frame->header.cmd_status = frame_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); } |