[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/ivshmem.c don't check for negative values on
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH] hw/ivshmem.c don't check for negative values on unsigned data types |
Date: |
Sat, 4 Sep 2010 10:06:08 +0000 |
Thanks, applied.
On Mon, Aug 30, 2010 at 10:31 AM, <address@hidden> wrote:
> From: Jes Sorensen <address@hidden>
>
> There is no need to check for dest < 0 or vector >= 0 as both are
> uint16_t.
>
> This should fix problems with broken build with aggressive compiler
> flags. Reported by Xudong Hao <address@hidden>
>
> Signed-off-by: Jes Sorensen <address@hidden>
> ---
> hw/ivshmem.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ivshmem.c b/hw/ivshmem.c
> index bbb5cba..afebbc3 100644
> --- a/hw/ivshmem.c
> +++ b/hw/ivshmem.c
> @@ -199,13 +199,13 @@ static void ivshmem_io_writel(void *opaque,
> target_phys_addr_t addr,
>
> case DOORBELL:
> /* check that dest VM ID is reasonable */
> - if ((dest < 0) || (dest > s->max_peer)) {
> + if (dest > s->max_peer) {
> IVSHMEM_DPRINTF("Invalid destination VM ID (%d)\n", dest);
> break;
> }
>
> /* check doorbell range */
> - if ((vector >= 0) && (vector < s->peers[dest].nb_eventfds)) {
> + if (vector < s->peers[dest].nb_eventfds) {
> IVSHMEM_DPRINTF("Writing %" PRId64 " to VM %d on vector %d\n",
> write_one, dest, vector);
> if (write(s->peers[dest].eventfds[vector],
> --
> 1.7.2.2
>
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH] hw/ivshmem.c don't check for negative values on unsigned data types,
Blue Swirl <=