Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88305
b: refs/heads/master
c: e56cfad
h: refs/heads/master
i:
  88303: 2edba1b
v: v3
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Apr 13, 2008
1 parent 77a2c73 commit 694e937
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 028b027524b162eef90839a92ba4b8bddf23e06c
refs/heads/master: e56cfad132f2ae269082359d279c17230c987e74
12 changes: 9 additions & 3 deletions trunk/net/sched/cls_u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ static void u32_destroy(struct tcf_proto *tp)
}
}

for (ht=tp_c->hlist; ht; ht = ht->next)
for (ht = tp_c->hlist; ht; ht = ht->next) {
ht->refcnt--;
u32_clear_hnode(tp, ht);
}

while ((ht = tp_c->hlist) != NULL) {
tp_c->hlist = ht->next;
Expand Down Expand Up @@ -441,8 +443,12 @@ static int u32_delete(struct tcf_proto *tp, unsigned long arg)
if (tp->root == ht)
return -EINVAL;

if (--ht->refcnt == 0)
if (ht->refcnt == 1) {
ht->refcnt--;
u32_destroy_hnode(tp, ht);
} else {
return -EBUSY;
}

return 0;
}
Expand Down Expand Up @@ -568,7 +574,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
if (ht == NULL)
return -ENOBUFS;
ht->tp_c = tp_c;
ht->refcnt = 0;
ht->refcnt = 1;
ht->divisor = divisor;
ht->handle = handle;
ht->prio = tp->prio;
Expand Down

0 comments on commit 694e937

Please sign in to comment.