diff options
Diffstat (limited to 'net/sched/act_nat.c')
-rw-r--r-- | net/sched/act_nat.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 45923ebb7a4f..7b858c11b1b5 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -44,6 +44,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, | |||
44 | struct tc_nat *parm; | 44 | struct tc_nat *parm; |
45 | int ret = 0, err; | 45 | int ret = 0, err; |
46 | struct tcf_nat *p; | 46 | struct tcf_nat *p; |
47 | u32 index; | ||
47 | 48 | ||
48 | if (nla == NULL) | 49 | if (nla == NULL) |
49 | return -EINVAL; | 50 | return -EINVAL; |
@@ -56,13 +57,13 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, | |||
56 | if (tb[TCA_NAT_PARMS] == NULL) | 57 | if (tb[TCA_NAT_PARMS] == NULL) |
57 | return -EINVAL; | 58 | return -EINVAL; |
58 | parm = nla_data(tb[TCA_NAT_PARMS]); | 59 | parm = nla_data(tb[TCA_NAT_PARMS]); |
59 | 60 | index = parm->index; | |
60 | err = tcf_idr_check_alloc(tn, &parm->index, a, bind); | 61 | err = tcf_idr_check_alloc(tn, &index, a, bind); |
61 | if (!err) { | 62 | if (!err) { |
62 | ret = tcf_idr_create(tn, parm->index, est, a, | 63 | ret = tcf_idr_create(tn, index, est, a, |
63 | &act_nat_ops, bind, false); | 64 | &act_nat_ops, bind, false); |
64 | if (ret) { | 65 | if (ret) { |
65 | tcf_idr_cleanup(tn, parm->index); | 66 | tcf_idr_cleanup(tn, index); |
66 | return ret; | 67 | return ret; |
67 | } | 68 | } |
68 | ret = ACT_P_CREATED; | 69 | ret = ACT_P_CREATED; |