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 | |
parent | 7f6613cedc59fa849105668ae971dc31004bca1c (diff) |
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')
-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 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. */ |