The caller of netdev_get_qos() is responsible for freeing its 'details'
smap.

Also, the previous qdisc details, for some arbitrary previous type of QoS,
aren't relevant for changing the type of QoS.

Signed-off-by: Ben Pfaff <[email protected]>
---
 ovn/controller/binding.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
index 25592c2..1c02efd 100644
--- a/ovn/controller/binding.c
+++ b/ovn/controller/binding.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016 Nicira, Inc.
+/* Copyright (c) 2015, 2016, 2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -251,11 +251,14 @@ setup_qos(const char *egress_iface, struct hmap 
*queue_map)
     smap_init(&qdisc_details);
     if (netdev_get_qos(netdev_phy, &qdisc_type, &qdisc_details) != 0 ||
         qdisc_type[0] == '\0') {
+        smap_destroy(&qdisc_details);
         /* Qos is not supported. */
         return;
     }
+    smap_destroy(&qdisc_details);
+
     if (strcmp(qdisc_type, OVN_QOS_TYPE)) {
-        error = netdev_set_qos(netdev_phy, OVN_QOS_TYPE, &qdisc_details);
+        error = netdev_set_qos(netdev_phy, OVN_QOS_TYPE, NULL);
         if (error) {
             VLOG_WARN_RL(&rl, "%s: could not configure QoS (%s)",
                          egress_iface, ovs_strerror(error));
-- 
2.10.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to