On Thu, May 2, 2013 at 10:20 AM, Jesse Gross <[email protected]> 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 <[email protected]>
> ---
> 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 <[email protected]>
> reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
> if (!reply) {
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> [email protected]
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev