summaryrefslogtreecommitdiffstats
path: root/kernel/ipt_ULOG.c
diff options
context:
space:
mode:
authorlaforge <laforge>2002-04-10 09:21:41 +0000
committerlaforge <laforge>2002-04-10 09:21:41 +0000
commit47715347d9012e646505443fea53d320e90f4160 (patch)
treea475aaca70dc6770346a7df2b4a41c2829e069b4 /kernel/ipt_ULOG.c
parent70afcc601ae781d7d303ac89e310b522341cfd1d (diff)
fix potential memory hole and oops-after-rmmod
Diffstat (limited to 'kernel/ipt_ULOG.c')
-rw-r--r--kernel/ipt_ULOG.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/ipt_ULOG.c b/kernel/ipt_ULOG.c
index 369ee2e..d6e5162 100644
--- a/kernel/ipt_ULOG.c
+++ b/kernel/ipt_ULOG.c
@@ -29,7 +29,7 @@
* Specify, after how many clock ticks (intel: 100 per second) the queue
* should be flushed even if it is not full yet.
*
- * $Id: ipt_ULOG.c,v 1.15 2002/01/18 21:33:19 laforge Exp $
+ * $Id: ipt_ULOG.c,v 1.16 2002/02/13 07:14:53 laforge Exp $
*/
#include <linux/module.h>
@@ -339,8 +339,25 @@ static int __init init(void)
static void __exit fini(void)
{
+ struct ulog_buff_t *ub;
+ int i;
+
DEBUGP("ipt_ULOG: cleanup_module\n");
+ /* remove pending timers and free allocated skb's */
+ for (i = 0; i < ULOG_MAXNLGROUPS; i++) {
+ ub = &ulog_buffers[i];
+ if (timer_pending(&ub->timer)) {
+ DEBUGP("timer was pending, deleting\n");
+ del_timer(&ub->timer);
+ }
+
+ if (ub->skb) {
+ kfree_skb(ub->skb);
+ ub->skb = NULL;
+ }
+ }
+
ipt_unregister_target(&ipt_ulog_reg);
sock_release(nflognl->socket);
}