projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53254e5
)
scsi-generic: check the return value of bdrv_aio_ioctl in execute_command
author
Pavel Hrdina
<phrdina@redhat.com>
Wed, 29 May 2013 12:12:10 +0000
(14:12 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Tue, 18 Jun 2013 10:43:03 +0000
(12:43 +0200)
This fixes the bug introduced by this commit
ad54ae80c73f
.
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: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-generic.c
patch
|
blob
|
history
diff --git
a/hw/scsi/scsi-generic.c
b/hw/scsi/scsi-generic.c
index 19bd36cd541b400b549b2ae701dae2abb29e5f7e..8f195bec00a089d8faf9a08b3abdef65eb03932c 100644
(file)
--- a/
hw/scsi/scsi-generic.c
+++ b/
hw/scsi/scsi-generic.c
@@
-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;
}