]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
nbd: Fix overflow return value
authorYik Fang <eric.fangyi@huawei.com>
Thu, 12 Feb 2015 06:21:51 +0000 (06:21 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 18 Mar 2015 11:02:37 +0000 (12:02 +0100)
The value of reply.error should be the type unsigned int.

Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
Message-Id: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
nbd.c

diff --git a/nbd.c b/nbd.c
index 71159aff6a02d41f1003b423e58971430618d0cc..02ba0fe252c3adfd66ce00819de7bde7982998a8 100644 (file)
--- a/nbd.c
+++ b/nbd.c
@@ -1295,7 +1295,7 @@ static void nbd_trip(void *opaque)
     default:
         LOG("invalid request type (%u) received", request.type);
     invalid_request:
-        reply.error = -EINVAL;
+        reply.error = EINVAL;
     error_reply:
         if (nbd_co_send_reply(req, &reply, 0) < 0) {
             goto out;