Thanks for the fix.

Reviewed-by: Yifeng Sun <[email protected]>

On Fri, Mar 23, 2018 at 3:46 PM, Ben Pfaff <[email protected]> wrote:

> valgrind regards a block to be "possibly" leaked when no pointers exist to
> the beginning of the block but some pointers do point to the middle of the
> block.  By moving the hmap_node in struct seq_waiter from the middle of the
> struct to the beginning, as this commit does, the pointers to the node from
> the hmap in struct seq point to the beginning of the block, which reassures
> valgrind.
>
> Signed-off-by: Ben Pfaff <[email protected]>
> ---
>  lib/seq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/seq.c b/lib/seq.c
> index a39c809fc39a..6581cb06baa1 100644
> --- a/lib/seq.c
> +++ b/lib/seq.c
> @@ -38,8 +38,8 @@ struct seq {
>
>  /* A thread waiting on a particular seq. */
>  struct seq_waiter {
> -    struct seq *seq OVS_GUARDED;            /* Seq being waited for. */
>      struct hmap_node hmap_node OVS_GUARDED; /* In 'seq->waiters'. */
> +    struct seq *seq OVS_GUARDED;            /* Seq being waited for. */
>      unsigned int ovsthread_id OVS_GUARDED;  /* Key in 'waiters' hmap. */
>
>      struct seq_thread *thread OVS_GUARDED;  /* Thread preparing to wait.
> */
> --
> 2.16.1
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to