Skip to content
Snippets Groups Projects
Commit d836f8d3 authored by Pavel Hrdina's avatar Pavel Hrdina Committed by Paolo Bonzini
Browse files

scsi-generic: check the return value of bdrv_aio_ioctl in execute_command


This fixes the bug introduced by this commit ad54ae80.
The bdrv_aio_ioctl() still could return null and we should return an error
in that case.

Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarPavel Hrdina <phrdina@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 53254e56
No related branches found
No related tags found
No related merge requests found
......@@ -174,6 +174,9 @@ static int execute_command(BlockDriverState *bdrv,
r->io_header.flags |= SG_FLAG_DIRECT_IO;
r->req.aiocb = bdrv_aio_ioctl(bdrv, SG_IO, &r->io_header, complete, r);
if (r->req.aiocb == NULL) {
return -EIO;
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment