diff options
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index cf823c21c166..29d8061fa153 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -581,18 +581,23 @@ ebt_cleanup_match(struct ebt_entry_match *m, unsigned int *i) | |||
581 | static inline int | 581 | static inline int |
582 | ebt_cleanup_watcher(struct ebt_entry_watcher *w, unsigned int *i) | 582 | ebt_cleanup_watcher(struct ebt_entry_watcher *w, unsigned int *i) |
583 | { | 583 | { |
584 | struct xt_tgdtor_param par; | ||
585 | |||
584 | if (i && (*i)-- == 0) | 586 | if (i && (*i)-- == 0) |
585 | return 1; | 587 | return 1; |
586 | if (w->u.watcher->destroy) | ||
587 | w->u.watcher->destroy(w->u.watcher, w->data); | ||
588 | module_put(w->u.watcher->me); | ||
589 | 588 | ||
589 | par.target = w->u.watcher; | ||
590 | par.targinfo = w->data; | ||
591 | if (par.target->destroy != NULL) | ||
592 | par.target->destroy(&par); | ||
593 | module_put(par.target->me); | ||
590 | return 0; | 594 | return 0; |
591 | } | 595 | } |
592 | 596 | ||
593 | static inline int | 597 | static inline int |
594 | ebt_cleanup_entry(struct ebt_entry *e, unsigned int *cnt) | 598 | ebt_cleanup_entry(struct ebt_entry *e, unsigned int *cnt) |
595 | { | 599 | { |
600 | struct xt_tgdtor_param par; | ||
596 | struct ebt_entry_target *t; | 601 | struct ebt_entry_target *t; |
597 | 602 | ||
598 | if (e->bitmask == 0) | 603 | if (e->bitmask == 0) |
@@ -603,10 +608,12 @@ ebt_cleanup_entry(struct ebt_entry *e, unsigned int *cnt) | |||
603 | EBT_WATCHER_ITERATE(e, ebt_cleanup_watcher, NULL); | 608 | EBT_WATCHER_ITERATE(e, ebt_cleanup_watcher, NULL); |
604 | EBT_MATCH_ITERATE(e, ebt_cleanup_match, NULL); | 609 | EBT_MATCH_ITERATE(e, ebt_cleanup_match, NULL); |
605 | t = (struct ebt_entry_target *)(((char *)e) + e->target_offset); | 610 | t = (struct ebt_entry_target *)(((char *)e) + e->target_offset); |
606 | if (t->u.target->destroy) | ||
607 | t->u.target->destroy(t->u.target, t->data); | ||
608 | module_put(t->u.target->me); | ||
609 | 611 | ||
612 | par.target = t->u.target; | ||
613 | par.targinfo = t->data; | ||
614 | if (par.target->destroy != NULL) | ||
615 | par.target->destroy(&par); | ||
616 | module_put(par.target->me); | ||
610 | return 0; | 617 | return 0; |
611 | } | 618 | } |
612 | 619 | ||