diff mbox

nbd: Fix overflow return value

Message ID 54F3BC0A.4010209@huawei.com
State New
Headers show

Commit Message

Fangyi (C) March 2, 2015, 1:25 a.m. UTC
PING
The value of reply.error should be the type unsigned int.

Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
---
  nbd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

-- 1.8.5

Comments

Markus Armbruster March 2, 2015, 9:48 a.m. UTC | #1
"Fangyi (C)" <bruce.fon@huawei.com> writes:

> 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 <pbonzini@redhat.com> (odd fixer:Network Block Dev...)

I fixed that for you.

> The value of reply.error should be the type unsigned int.
>
> Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
> ---
>  nbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/nbd.c b/nbd.c
> index e56afbc1..30e2f3b 100644
> --- 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;
> -- 1.8.5
Yik Fang March 9, 2015, 2:16 a.m. UTC | #2
Thanks to Markus for your help!


On 2015/3/2 9:25, Fangyi (C) wrote:
> PING
> The value of reply.error should be the type unsigned int.
>
> Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
> ---
>   nbd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/nbd.c b/nbd.c
> index e56afbc1..30e2f3b 100644
> --- 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;
> -- 1.8.5
>
>
>
>
Yik Fang March 11, 2015, 1:27 a.m. UTC | #3
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 <eric.fangyi@huawei.com>
收件人: armbru@redhat.com, qemu-devel@nongnu.org
抄送: pbonzini@redhat.com

Thanks to Markus for your help!


On 2015/3/2 9:25, Fangyi (C) wrote:
> PING
> The value of reply.error should be the type unsigned int.
>
> Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
> ---
>   nbd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/nbd.c b/nbd.c
> index e56afbc1..30e2f3b 100644
> --- 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;
> -- 1.8.5
>
>
>
>
diff mbox

Patch

diff --git a/nbd.c b/nbd.c
index e56afbc1..30e2f3b 100644
--- 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;