]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: tc use TAKE_PTR
authorSusant Sahani <ssahani@vmware.com>
Sun, 17 Jan 2021 10:14:15 +0000 (11:14 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Jan 2021 14:26:14 +0000 (23:26 +0900)
src/network/tc/qfq.c
src/network/tc/sfb.c
src/network/tc/sfq.c
src/network/tc/tbf.c
src/network/tc/tclass.c
src/network/tc/teql.c

index 320f2c1c5251a3e3f77c215d2feb05926f251aa0..d2e7b875efc310f3bbadb24c506e91968cce7f29 100644 (file)
@@ -85,7 +85,7 @@ int config_parse_quick_fair_queueing_weight(
 
         if (isempty(rvalue)) {
                 qfq->weight = 0;
-                tclass = NULL;
+                TAKE_PTR(tclass);
                 return 0;
         }
 
@@ -105,7 +105,7 @@ int config_parse_quick_fair_queueing_weight(
         }
 
         qfq->weight = v;
-        tclass = NULL;
+        TAKE_PTR(tclass);
 
         return 0;
 }
@@ -146,7 +146,7 @@ int config_parse_quick_fair_queueing_max_packet(
 
         if (isempty(rvalue)) {
                 qfq->max_packet = 0;
-                tclass = NULL;
+                TAKE_PTR(tclass);
                 return 0;
         }
 
@@ -166,7 +166,7 @@ int config_parse_quick_fair_queueing_max_packet(
         }
 
         qfq->max_packet = (uint32_t) v;
-        tclass = NULL;
+        TAKE_PTR(tclass);
 
         return 0;
 }
index 674fdf6ac7d71adfa7eb408cb7efce16ab5f3be8..a4ca4884b182bd1d29a8bdbbb22f9277d02fd3bf 100644 (file)
@@ -84,7 +84,7 @@ int config_parse_stochastic_fair_blue_u32(
         if (isempty(rvalue)) {
                 sfb->packet_limit = 0;
 
-                qdisc = NULL;
+                TAKE_PTR(qdisc);
                 return 0;
         }
 
@@ -96,7 +96,7 @@ int config_parse_stochastic_fair_blue_u32(
                 return 0;
         }
 
-        qdisc = NULL;
+        TAKE_PTR(qdisc);
 
         return 0;
 }
index 387be83a99698d896c5f1e9dfa638280edb5fb39..f67ffc186df7c5933cb4f16ebfb94aa3f6948181 100644 (file)
@@ -67,7 +67,7 @@ int config_parse_stochastic_fairness_queueing_perturb_period(
         if (isempty(rvalue)) {
                 sfq->perturb_period = 0;
 
-                qdisc = NULL;
+                TAKE_PTR(qdisc);
                 return 0;
         }
 
@@ -79,7 +79,7 @@ int config_parse_stochastic_fairness_queueing_perturb_period(
                 return 0;
         }
 
-        qdisc = NULL;
+        TAKE_PTR(qdisc);
 
         return 0;
 }
index 2d84c5a833b95d8817df107905c609df4bf88eb6..50d14a535646d2e3f3fb19f9fd735717f7d7ce43 100644 (file)
@@ -156,7 +156,7 @@ int config_parse_token_bucket_filter_size(
                 else
                         assert_not_reached("unknown lvalue");
 
-                qdisc = NULL;
+                TAKE_PTR(qdisc);
                 return 0;
         }
 
@@ -179,7 +179,7 @@ int config_parse_token_bucket_filter_size(
         else
                 assert_not_reached("unknown lvalue");
 
-        qdisc = NULL;
+        TAKE_PTR(qdisc);
 
         return 0;
 }
@@ -227,7 +227,7 @@ int config_parse_token_bucket_filter_rate(
         if (isempty(rvalue)) {
                 *p = 0;
 
-                qdisc = NULL;
+                TAKE_PTR(qdisc);
                 return 0;
         }
 
index 4c03587211e496e971826c97f459afd25210ecba..64bdfbb90b01b7e335cce35254dea0c0c84df7c1 100644 (file)
@@ -230,7 +230,7 @@ int config_parse_tclass_parent(
                 }
         }
 
-        tclass = NULL;
+        TAKE_PTR(tclass);
 
         return 0;
 }
@@ -267,7 +267,7 @@ int config_parse_tclass_classid(
 
         if (isempty(rvalue)) {
                 tclass->classid = TC_H_UNSPEC;
-                tclass = NULL;
+                TAKE_PTR(tclass);
                 return 0;
         }
 
@@ -279,7 +279,7 @@ int config_parse_tclass_classid(
                 return 0;
         }
 
-        tclass = NULL;
+        TAKE_PTR(tclass);
 
         return 0;
 }
index 0da2fc357e2a7c7328bbaa54370cea9b8b1a2b48..633a7827b4b34048eb0b673d5a14626d23ee029c 100644 (file)
@@ -68,7 +68,7 @@ int config_parse_trivial_link_equalizer_id(
         if (isempty(rvalue)) {
                 teql->id = 0;
 
-                qdisc = NULL;
+                TAKE_PTR(qdisc);
                 return 0;
         }
 
@@ -86,6 +86,6 @@ int config_parse_trivial_link_equalizer_id(
 
         teql->id = id;
 
-        qdisc = NULL;
+        TAKE_PTR(qdisc);
         return 0;
 }