Skip to contentSkip to conversation

nbd: Fix overflow return value

PATCH In review Yik Fang 5 participants 7 messages Feb 12, 2015 – Mar 11, 2015

lore
Share & tools
lore

Yik Fang

author
#0 lore raw

PATCH 1/1 nbd: Fix overflow return value

The value of reply.error should be the type unsigned int.

---
 nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +1 -1
index e56afbc1..30e2f3b 100644
@@ -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;
Signature · 1 line
1.8.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Yik Fang

The value of reply.error should be the type unsigned int.

---
 nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +1 -1
index e56afbc1..30e2f3b 100644
@@ -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;
Signature · 1 line
1.8.5
#2 lore raw

PATCH 1/1 nbd: Fix overflow return value

In reply to Yik Fang

PING
The value of reply.error should be the type unsigned int.

---
 nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +1 -1
index e56afbc1..30e2f3b 100644
@@ -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;

-- 1.8.5

#3 lore raw
Quoted 1 line · Fangyi (C)

PING

Please drop this line, it doesn't belong to the commit message.

You copied a bunch of people, but forgot the maintainer:

$ scripts/get_maintainer.pl -f nbd.c 
Paolo Bonzini <[email protected]> (odd fixer:Network Block Dev...)

I fixed that for you.

Quoted 21 lines

The value of reply.error should be the type unsigned int.

---
 nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +1 -2
index e56afbc1..30e2f3b 100644
@@ -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;
-- 1.8.5
author
#4 lore raw
In reply to Fangyi (C)

Thanks to Markus for your help!

Quoted 26 lines · Fangyi (C)

PING
The value of reply.error should be the type unsigned int.

---
  nbd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +1 -2
index e56afbc1..30e2f3b 100644
@@ -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;
-- 1.8.5
author
#5 lore raw

Paolo,

Can you have a look at this patch, and give me some advices?

Regards,
Yik Fang

-------- 转发的消息 --------
主题: Re: [Qemu-devel] [PATCH] nbd: Fix overflow return value 日期: Mon, 9 Mar 2015 10:16:07 +0800
发件人: Yik Fang <[email protected]>
收件人: [email protected], [email protected]
抄送: [email protected]

Thanks to Markus for your help!

Quoted 26 lines · Fangyi (C)

PING
The value of reply.error should be the type unsigned int.

---
  nbd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +1 -2
index e56afbc1..30e2f3b 100644
@@ -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;
-- 1.8.5
#6 lore raw
In reply to Yik Fang
Quoted 13 lines · Yik Fang

The value of reply.error should be the type unsigned int.

---
 nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nbd.c +0 -0
index e56afbc1..30e2f3b 100644

nbd.c static void nbd_trip(void *opaque) · line 1301

Quoted 8 lines
nbd.c +1 -1
@@ -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;

Applied to my local branch, thanks.

Paolo