diff mbox

[04/25] nbd: Fix response to invalid requests

Message ID 1424887718-10800-5-git-send-email-mreitz@redhat.com
State New
Headers show

Commit Message

Max Reitz Feb. 25, 2015, 6:08 p.m. UTC
reply.error is a positive errno value, not a negative one.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Max Reitz March 2, 2015, 4:52 p.m. UTC | #1
On 2015-02-25 at 13:08, Max Reitz wrote:
> reply.error is a positive errno value, not a negative one.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   nbd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

This is (functionally) the same patch as 
http://lists.nongnu.org/archive/html/qemu-devel/2015-02/msg02258.html, 
so this should be dropped if that one is applied before.

Max
diff mbox

Patch

diff --git a/nbd.c b/nbd.c
index 5d50f22..b4776ce 100644
--- a/nbd.c
+++ b/nbd.c
@@ -1330,7 +1330,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;