Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e35670614d10588fb9c6ed32ecd55b8242e98872
Commit:     e35670614d10588fb9c6ed32ecd55b8242e98872
Parent:     5faa1f4cb5a1f124f76172d775467f4a9db5b452
Author:     Michal Miroslaw <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 28 14:44:21 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:53:38 2007 -0700

    [NETFILTER]: nfnetlink_log: kill duplicate code
    
    Kill some cut'n'paste effect.
    Just after __nfulnl_send() returning, inst->skb is always NULL.
    
    Signed-off-by: Michal Miroslaw <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nfnetlink_log.c |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index a90a26b..512741a 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -188,7 +188,7 @@ out_unlock:
        return NULL;
 }
 
-static int __nfulnl_send(struct nfulnl_instance *inst);
+static void __nfulnl_flush(struct nfulnl_instance *inst);
 
 static void
 __instance_destroy(struct nfulnl_instance *inst)
@@ -202,17 +202,8 @@ __instance_destroy(struct nfulnl_instance *inst)
        /* then flush all pending packets from skb */
 
        spin_lock_bh(&inst->lock);
-       if (inst->skb) {
-               /* timer "holds" one reference (we have one more) */
-               if (del_timer(&inst->timer))
-                       instance_put(inst);
-               if (inst->qlen)
-                       __nfulnl_send(inst);
-               if (inst->skb) {
-                       kfree_skb(inst->skb);
-                       inst->skb = NULL;
-               }
-       }
+       if (inst->skb)
+               __nfulnl_flush(inst);
        spin_unlock_bh(&inst->lock);
 
        /* and finally put the refcount */
@@ -364,6 +355,16 @@ nlmsg_failure:
        return status;
 }
 
+static void
+__nfulnl_flush(struct nfulnl_instance *inst)
+{
+       /* timer holds a reference */
+       if (del_timer(&inst->timer))
+               instance_put(inst);
+       if (inst->skb)
+               __nfulnl_send(inst);
+}
+
 static void nfulnl_timer(unsigned long data)
 {
        struct nfulnl_instance *inst = (struct nfulnl_instance *)data;
@@ -650,10 +651,7 @@ nfulnl_log_packet(unsigned int pf,
                 * enough room in the skb left. flush to userspace. */
                UDEBUG("flushing old skb\n");
 
-               /* timer "holds" one reference (we have another one) */
-               if (del_timer(&inst->timer))
-                       instance_put(inst);
-               __nfulnl_send(inst);
+               __nfulnl_flush(inst);
        }
 
        if (!inst->skb) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to