On Thu, May 2, 2013 at 10:38 AM, Pravin Shelar <pshe...@nicira.com> wrote: > On Thu, May 2, 2013 at 10:20 AM, Jesse Gross <je...@nicira.com> wrote: >> It is an error to try to change the type of a vport using the set >> command. However, while we check that this is an error, we still >> proceed to allocate memory which then gets freed immediately. >> This stops processing after noticing the error, which does not >> actually fix a bug but is more correct. >> >> Signed-off-by: Jesse Gross <je...@nicira.com> >> --- >> datapath/datapath.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/datapath/datapath.c b/datapath/datapath.c >> index cf901d2..c0b8849 100644 >> --- a/datapath/datapath.c >> +++ b/datapath/datapath.c >> @@ -2107,8 +2107,10 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, >> struct genl_info *info) >> >> err = 0; > No need to set it. > >> if (a[OVS_VPORT_ATTR_TYPE] && >> - nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) >> + nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) { >> err = -EINVAL; >> + goto exit_unlock; >> + } >> > We can also remove err check done later which is always true now. > > otherwise looks good. > Acked-by: Pravin B Shelar <pshe...@nicira.com>
Thanks, I fixed those up and pushed. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev