summaryrefslogtreecommitdiff
path: root/hw/scsi
diff options
context:
space:
mode:
authorPrasad Joshi <prasadjoshi.linux@gmail.com>2014-03-19 07:10:32 +0530
committerPaolo Bonzini <pbonzini@redhat.com>2014-03-26 13:19:22 +0100
commitb0f49d138777fb6609aa2ea96d2c59fb872d2c2d (patch)
tree50755d0964f5ee1be083bbf1b42b7d639ba65328 /hw/scsi
parent7f6613cedc59fa849105668ae971dc31004bca1c (diff)
downloadqemu-b0f49d138777fb6609aa2ea96d2c59fb872d2c2d.tar.gz
qemu-b0f49d138777fb6609aa2ea96d2c59fb872d2c2d.tar.bz2
qemu-b0f49d138777fb6609aa2ea96d2c59fb872d2c2d.zip
scsi: check req pointer before dereferencing it
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi')
-rw-r--r--hw/scsi/vmw_pvscsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 7d344b944e..e35bff76a9 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -479,12 +479,13 @@ static void
pvscsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
{
PVSCSIRequest *pvscsi_req = req->hba_private;
- PVSCSIState *s = pvscsi_req->dev;
+ PVSCSIState *s;
if (!pvscsi_req) {
trace_pvscsi_command_complete_not_found(req->tag);
return;
}
+ s = pvscsi_req->dev;
if (resid) {
/* Short transfer. */