atm: clip: move clip_devs check to clip_push
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Mon, 21 Nov 2011 10:25:56 +0000 (10:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Nov 2011 21:15:34 +0000 (16:15 -0500)
This will allow further cleanup.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/atm/clip.c

index b3ab7ddc1185a03a0a139382dc1e794ca2e669d3..e2de7c548b3a51544416b2b3fd48ce53ac757b4c 100644 (file)
@@ -189,6 +189,13 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
        struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
 
        pr_debug("\n");
+
+       if (!clip_devs) {
+               atm_return(vcc, skb->truesize);
+               kfree_skb(skb);
+               return;
+       }
+
        if (!skb) {
                pr_debug("removing VCC %p\n", clip_vcc);
                if (clip_vcc->entry)
@@ -480,13 +487,9 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
        spin_unlock_irqrestore(&rq->lock, flags);
 
        /* re-process everything received between connection setup and MKIP */
-       skb_queue_walk_safe(&queue, skb, tmp) {
-               if (!clip_devs) {
-                       atm_return(vcc, skb->truesize);
-                       kfree_skb(skb);
-               } else
-                       clip_push(vcc, skb);
-       }
+       skb_queue_walk_safe(&queue, skb, tmp)
+               clip_push(vcc, skb);
+
        return 0;
 }