>
> This is not safe against simultaneous calls for the same port, but it
>  would be if the assignment to 'old' happened with the lock held:
> > +void
> > +stp_port_set_name(struct stp_port *p, const char *name)
> > +{
> > +    char *old = p->port_name;
> > +
> > +    ovs_mutex_lock(&mutex);
> > +    p->port_name = xstrdup(name);
> > +    free(old);
> > +    ovs_mutex_unlock(&mutex);
> > +}
>
> Acked-by: Ben Pfaff <b...@nicira.com>
>


Thanks a lot for pointing this out!

Applied to master,~
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to