aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/act_simple.c')
-rw-r--r--net/sched/act_simple.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index f28ddbabff76..33aefa25b545 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -95,6 +95,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
95 struct tcf_defact *d; 95 struct tcf_defact *d;
96 bool exists = false; 96 bool exists = false;
97 int ret = 0, err; 97 int ret = 0, err;
98 u32 index;
98 99
99 if (nla == NULL) 100 if (nla == NULL)
100 return -EINVAL; 101 return -EINVAL;
@@ -108,7 +109,8 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
108 return -EINVAL; 109 return -EINVAL;
109 110
110 parm = nla_data(tb[TCA_DEF_PARMS]); 111 parm = nla_data(tb[TCA_DEF_PARMS]);
111 err = tcf_idr_check_alloc(tn, &parm->index, a, bind); 112 index = parm->index;
113 err = tcf_idr_check_alloc(tn, &index, a, bind);
112 if (err < 0) 114 if (err < 0)
113 return err; 115 return err;
114 exists = err; 116 exists = err;
@@ -119,15 +121,15 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
119 if (exists) 121 if (exists)
120 tcf_idr_release(*a, bind); 122 tcf_idr_release(*a, bind);
121 else 123 else
122 tcf_idr_cleanup(tn, parm->index); 124 tcf_idr_cleanup(tn, index);
123 return -EINVAL; 125 return -EINVAL;
124 } 126 }
125 127
126 if (!exists) { 128 if (!exists) {
127 ret = tcf_idr_create(tn, parm->index, est, a, 129 ret = tcf_idr_create(tn, index, est, a,
128 &act_simp_ops, bind, false); 130 &act_simp_ops, bind, false);
129 if (ret) { 131 if (ret) {
130 tcf_idr_cleanup(tn, parm->index); 132 tcf_idr_cleanup(tn, index);
131 return ret; 133 return ret;
132 } 134 }
133 135