aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2012-04-26 13:45:30 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-04-26 17:54:22 +0200
commitb3adf53a3a10a1ca8347167907e4cf8bbd0204f1 (patch)
tree656e6728dfa8c369f90a5134fe33197ee5ac5469 /block
parentec4a804792ea20f716371a0a661efc9ec15c7ff0 (diff)
downloadqemu-b3adf53a3a10a1ca8347167907e4cf8bbd0204f1.zip
qemu-b3adf53a3a10a1ca8347167907e4cf8bbd0204f1.tar.gz
qemu-b3adf53a3a10a1ca8347167907e4cf8bbd0204f1.tar.bz2
nbd: Fix uninitialised use of s->sock
s->sock is assigned only afterwards, so we're really registering an aio_fd_handler for file descriptor 0 here. Not exactly what we intended. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 56dbf6e..1212614 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -284,7 +284,7 @@ static int nbd_establish_connection(BlockDriverState *bs)
/* Now that we're connected, set the socket to be non-blocking and
* kick the reply mechanism. */
socket_set_nonblock(sock);
- qemu_aio_set_fd_handler(s->sock, nbd_reply_ready, NULL,
+ qemu_aio_set_fd_handler(sock, nbd_reply_ready, NULL,
nbd_have_request, s);
s->sock = sock;