Skip to content

Commit

Permalink
scsi: check req pointer before dereferencing it
Browse files Browse the repository at this point in the history
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
joshi-prasad authored and bonzini committed Mar 26, 2014
1 parent 7f6613c commit b0f49d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/scsi/vmw_pvscsi.c
Expand Up @@ -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. */
Expand Down

0 comments on commit b0f49d1

Please sign in to comment.