[ovs-dev] [PATCH] dpif-linux: Avoid valgrind warning in epoll_ctl() call.

Justin Pettit jpettit at nicira.com
Mon Dec 12 20:55:21 UTC 2011


Looks good.

--Justin


On Dec 9, 2011, at 3:59 PM, Ben Pfaff wrote:

> Valgrind points out correctly that there are uninitialized bytes in the
> 'event' structure.  That's OK, but it doesn't hurt to suppress the warning
> by zeroing all of the bytes.
> 
> This doesn't fix a real bug.
> 
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
> lib/dpif-linux.c |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
> index 1f6c2c0..317274e 100644
> --- a/lib/dpif-linux.c
> +++ b/lib/dpif-linux.c
> @@ -1026,6 +1026,7 @@ dpif_linux_recv_set_mask(struct dpif *dpif_, int listen_mask)
>                 return error;
>             }
> 
> +            memset(&event, 0, sizeof event);
>             event.events = EPOLLIN;
>             event.data.u32 = i;
>             if (epoll_ctl(dpif->epoll_fd, EPOLL_CTL_ADD,
> -- 
> 1.7.4.4
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list