diff options
author | Prasad Joshi <prasadjoshi.linux@gmail.com> | 2014-03-19 07:10:32 +0530 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-26 13:19:22 +0100 |
commit | b0f49d138777fb6609aa2ea96d2c59fb872d2c2d (patch) | |
tree | 50755d0964f5ee1be083bbf1b42b7d639ba65328 /hw/scsi/vmw_pvscsi.c | |
parent | 7f6613cedc59fa849105668ae971dc31004bca1c (diff) | |
download | qemu-b0f49d138777fb6609aa2ea96d2c59fb872d2c2d.zip qemu-b0f49d138777fb6609aa2ea96d2c59fb872d2c2d.tar.gz qemu-b0f49d138777fb6609aa2ea96d2c59fb872d2c2d.tar.bz2 |
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/vmw_pvscsi.c')
-rw-r--r-- | hw/scsi/vmw_pvscsi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index 7d344b9..e35bff7 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. */ |