[ovs-dev] [PATCH 2/2] ofproto: Add ref counting for variable length mf_fields.

Joe Stringer joe at ovn.org
Fri Mar 10 19:36:43 UTC 2017


On 10 March 2017 at 11:34, Joe Stringer <joe at ovn.org> wrote:
> On 9 March 2017 at 10:22, Yi-Hung Wei <yihung.wei at gmail.com> wrote:
>> On Wed, Mar 8, 2017 at 11:40 AM, Joe Stringer <joe at ovn.org> wrote:
> diff --git a/lib/meta-flow.c b/lib/meta-flow.c
> index e844008f6294..bef5aad768a3 100644
> --- a/lib/meta-flow.c
> +++ b/lib/meta-flow.c
> @@ -2836,9 +2836,13 @@ mf_vl_mff_ref_cnt_mod(const struct vl_mff_map
> *map, uint64_t tlv_bitmap,
>             vmf = mf_get_vl_mff__(i + MFF_TUN_METADATA0, map);
>             if (vmf) {
>                 if (ref) {
> -                    ovs_refcount_ref(&vmf->ref_cnt);
> +                    if (ovs_refcount_ref(&vmf->ref_cnt) == 0) {
> +                        VLOG_WARN("Taking reference on freed VMF %d", i);
> +                    }

Turns out that ovs_refcount_ref() already asserts this ;-)


More information about the dev mailing list