diff options
| author | Davide Caratti <dcaratti@redhat.com> | 2018-05-16 06:54:29 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-05-16 14:41:44 -0400 |
| commit | 5a4931ae0193f8a4a97e8260fd0df1d705d83299 (patch) | |
| tree | e04538461d81b1e57d5f07516553357d1719a336 | |
| parent | e49ac9679eeb30abeb462cb459cc3ea8c81fbd1f (diff) | |
net/sched: fix refcnt leak in the error path of tcf_vlan_init()
Similarly to what was done with commit a52956dfc503 ("net sched actions:
fix refcnt leak in skbmod"), fix the error path of tcf_vlan_init() to avoid
refcnt leaks when wrong value of TCA_VLAN_PUSH_VLAN_PROTOCOL is given.
Fixes: 5026c9b1bafc ("net sched: vlan action fix late binding")
CC: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/sched/act_vlan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 853604685965..1fb39e1f9d07 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c | |||
| @@ -161,6 +161,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, | |||
| 161 | case htons(ETH_P_8021AD): | 161 | case htons(ETH_P_8021AD): |
| 162 | break; | 162 | break; |
| 163 | default: | 163 | default: |
| 164 | if (exists) | ||
| 165 | tcf_idr_release(*a, bind); | ||
| 164 | return -EPROTONOSUPPORT; | 166 | return -EPROTONOSUPPORT; |
| 165 | } | 167 | } |
| 166 | } else { | 168 | } else { |
