mirror of https://github.com/xqemu/xqemu.git
scsi: check req pointer before dereferencing it
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
7f6613cedc
commit
b0f49d1387
|
@ -479,12 +479,13 @@ static void
|
||||||
pvscsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
|
pvscsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
|
||||||
{
|
{
|
||||||
PVSCSIRequest *pvscsi_req = req->hba_private;
|
PVSCSIRequest *pvscsi_req = req->hba_private;
|
||||||
PVSCSIState *s = pvscsi_req->dev;
|
PVSCSIState *s;
|
||||||
|
|
||||||
if (!pvscsi_req) {
|
if (!pvscsi_req) {
|
||||||
trace_pvscsi_command_complete_not_found(req->tag);
|
trace_pvscsi_command_complete_not_found(req->tag);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
s = pvscsi_req->dev;
|
||||||
|
|
||||||
if (resid) {
|
if (resid) {
|
||||||
/* Short transfer. */
|
/* Short transfer. */
|
||||||
|
|
Loading…
Reference in New Issue