[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH for 2.10 v2 18/20] 9pfs: avoid sign conversion
From: |
Greg Kurz |
Subject: |
Re: [Qemu-trivial] [PATCH for 2.10 v2 18/20] 9pfs: avoid sign conversion error simplifying the code |
Date: |
Thu, 27 Jul 2017 13:40:05 +0200 |
On Wed, 26 Jul 2017 23:42:22 -0300
Philippe Mathieu-Daudé <address@hidden> wrote:
> (note this is how other functions also handle the errors).
>
> hw/9pfs/9p.c:948:18: warning: Loss of sign in implicit conversion
> offset = err;
> ^~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
Reviewed-by: Greg Kurz <address@hidden>
Now, I'm not sure this can be merged during hard freeze since it is
more code cleanup than actual bug fixing...
> hw/9pfs/9p.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index 333dbb6f8e..0a37c8bd13 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -945,7 +945,6 @@ static void coroutine_fn v9fs_version(void *opaque)
> v9fs_string_init(&version);
> err = pdu_unmarshal(pdu, offset, "ds", &s->msize, &version);
> if (err < 0) {
> - offset = err;
> goto out;
> }
> trace_v9fs_version(pdu->tag, pdu->id, s->msize, version.data);
> @@ -962,13 +961,12 @@ static void coroutine_fn v9fs_version(void *opaque)
>
> err = pdu_marshal(pdu, offset, "ds", s->msize, &version);
> if (err < 0) {
> - offset = err;
> goto out;
> }
> - offset += err;
> + err += offset;
> trace_v9fs_version_return(pdu->tag, pdu->id, s->msize, version.data);
> out:
> - pdu_complete(pdu, offset);
> + pdu_complete(pdu, err);
> v9fs_string_free(&version);
> }
>
pgpWlMEZ9Jk2E.pgp
Description: OpenPGP digital signature
- [Qemu-trivial] [PATCH for 2.10 v2 11/20] linux-user/sh4: fix incorrect memory write, (continued)
- [Qemu-trivial] [PATCH for 2.10 v2 11/20] linux-user/sh4: fix incorrect memory write, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 12/20] syscall: fix dereference of undefined pointer, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 13/20] syscall: fix use of uninitialized values, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 14/20] syscall: check inotify() and eventfd() return value, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 15/20] thunk: assert nb_fields is valid, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 17/20] bt-sdp: fix memory leak in sdp_service_record_build(), Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 18/20] 9pfs: avoid sign conversion error simplifying the code, Philippe Mathieu-Daudé, 2017/07/26
- Re: [Qemu-trivial] [PATCH for 2.10 v2 18/20] 9pfs: avoid sign conversion error simplifying the code,
Greg Kurz <=
- [Qemu-trivial] [PATCH for 2.10 v2 19/20] spapr_vio: fix overflow of qdevs in spapr_dt_vdevice(), Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 20/20] i2c/exynos4210: fix write to I2CADD register, bit 0 is not mapped, Philippe Mathieu-Daudé, 2017/07/26
- Re: [Qemu-trivial] [PATCH for 2.10 v2 00/20] fix bugs reported by Clang Static Analyzer, Michael Tokarev, 2017/07/28