]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: convert remaining non-symbolic return values in ndo_start_xmit() functions
authorPatrick McHardy <kaber@trash.net>
Mon, 6 Jul 2009 02:23:38 +0000 (19:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jul 2009 02:23:38 +0000 (19:23 -0700)
This patch converts the remaining occurences of raw return values to their
symbolic counterparts in ndo_start_xmit() functions that were missed by the
previous automatic conversion.

Additionally code that assumed the symbolic value of NETDEV_TX_OK to be zero
is changed to explicitly use NETDEV_TX_OK.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
52 files changed:
arch/xtensa/platforms/iss/network.c
drivers/isdn/hysdn/hysdn_net.c
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_ppp.c
drivers/net/3c501.c
drivers/net/7990.c
drivers/net/a2065.c
drivers/net/bonding/bond_3ad.c
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_main.c
drivers/net/defxx.c
drivers/net/depca.c
drivers/net/ibm_newemac/core.c
drivers/net/ifb.c
drivers/net/irda/ali-ircc.c
drivers/net/irda/donauboe.c
drivers/net/irda/nsc-ircc.c
drivers/net/irda/sir_dev.c
drivers/net/irda/smsc-ircc2.c
drivers/net/irda/via-ircc.c
drivers/net/lib8390.c
drivers/net/mlx4/en_tx.c
drivers/net/myri10ge/myri10ge.c
drivers/net/ni52.c
drivers/net/skfp/skfddi.c
drivers/net/sonic.c
drivers/net/tokenring/smctr.c
drivers/net/tokenring/tms380tr.c
drivers/net/tulip/dmfe.c
drivers/net/wan/dlci.c
drivers/net/wan/dscc4.c
drivers/net/wan/farsync.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/wanxl.c
drivers/net/wireless/hostap/hostap_80211_tx.c
drivers/net/wireless/ipw2x00/libipw_tx.c
drivers/net/wireless/prism54/islpci_eth.c
drivers/net/wireless/wavelan.c
drivers/net/wireless/wavelan_cs.c
drivers/net/wireless/wl3501_cs.c
drivers/s390/net/claw.c
drivers/s390/net/lcs.c
drivers/s390/net/netiucv.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/staging/rt2860/rt_main_dev.c
drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
drivers/staging/rtl8187se/r8180_core.c
drivers/staging/wlan-ng/p80211netdev.c
net/atm/mpc.c
net/core/dev.c
net/mac80211/tx.c

index edad4156d89a2ba30702bfda4f1b3c60dbad14dc..2f0b86b37cf9840b47d8281ad6794fab26a757dd 100644 (file)
@@ -545,7 +545,7 @@ static int iss_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
        spin_unlock_irqrestore(&lp->lock, flags);
 
        dev_kfree_skb(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
index 579974cf4c9a0b79eba54b564c66aa17337fdad3..c73004b3b2ac0f85dbb73e83d0f481c8dfcac0fd 100644 (file)
@@ -148,7 +148,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
        if (lp->sk_count <= 3) {
                schedule_work(&((hysdn_card *) dev->ml_priv)->irq_queue);
        }
-       return (0);             /* success */
+       return NETDEV_TX_OK;    /* success */
 }                              /* net_send_packet */
 
 
index 8209ed6c6d2939e27d5a24a71981274c448a3a63..57bf4bf502789cf75783ff9af288c64bdfdc5ef0 100644 (file)
@@ -1051,12 +1051,12 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
        isdn_net_dev *nd;
        isdn_net_local *slp;
        isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
-       int retv = 0;
+       int retv = NETDEV_TX_OK;
 
        if (((isdn_net_local *) netdev_priv(ndev))->master) {
                printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__);
                dev_kfree_skb(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        /* For the other encaps the header has already been built */
index aa30b5cb35133dd45f487a1a044757d820280154..2d14b64202a39d7b8745c97e0f2372b56e318aca 100644 (file)
@@ -1223,7 +1223,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
        isdn_net_dev *nd;
        unsigned int proto = PPP_IP;     /* 0x21 */
        struct ippp_struct *ipt,*ipts;
-       int slot, retval = 0;
+       int slot, retval = NETDEV_TX_OK;
 
        mlp = (isdn_net_local *) netdev_priv(netdev);
        nd = mlp->netdev;       /* get master lp */
@@ -1240,7 +1240,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
        if (!(ipts->pppcfg & SC_ENABLE_IP)) {   /* PPP connected ? */
                if (ipts->debug & 0x1)
                        printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
-               retval = 1;
+               retval = NETDEV_TX_BUSY;
                goto out;
        }
 
@@ -1261,7 +1261,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
        lp = isdn_net_get_locked_lp(nd);
        if (!lp) {
                printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
-               retval = 1;
+               retval = NETDEV_TX_BUSY;
                goto out;
        }
        /* we have our lp locked from now on */
index 367bec63620cf6ccff9ae115d873f94def35b8f2..e29fb1a4a611d5a38acd1f736d4ae8ec2d69fe4b 100644 (file)
@@ -485,7 +485,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        if (el_debug > 2)
                                pr_debug(" queued xmit.\n");
                        dev_kfree_skb(skb);
-                       return 0;
+                       return NETDEV_TX_OK;
                }
                /* A receive upset our load, despite our best efforts */
                if (el_debug > 2)
index 69f5b7d298a60b722dfe0b773713aca508d110d4..b1e5764628c60a1353616c41676df40e070a379e 100644 (file)
@@ -585,7 +585,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
                lp->tx_full = 1;
        spin_unlock_irqrestore (&lp->devlock, flags);
 
-        return 0;
+        return NETDEV_TX_OK;
 }
 EXPORT_SYMBOL_GPL(lance_start_xmit);
 
index 85a18175730ba249ab36c5985a654e34df1eb05c..7302e4385bc4dc6eb657ab360c84b5c9015a9d52 100644 (file)
@@ -553,11 +553,11 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
        volatile struct lance_regs *ll = lp->ll;
        volatile struct lance_init_block *ib = lp->init_block;
        int entry, skblen;
-       int status = 0;
+       int status = NETDEV_TX_OK;
        unsigned long flags;
 
        if (skb_padto(skb, ETH_ZLEN))
-               return 0;
+               return NETDEV_TX_OK;
        skblen = max_t(unsigned, skb->len, ETH_ZLEN);
 
        local_irq_save(flags);
index d4b570886c6e979c50ac08130b406e6d8fea7cb9..0e7dfe0981d99bf273326fe87240002f95e7c2a3 100644 (file)
@@ -2431,7 +2431,7 @@ out:
                dev_kfree_skb(skb);
        }
        read_unlock(&bond->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev)
index 46d312bedfb8ce027d246a33c483a70047932023..bf45d2002924cc4648370660a7be1a6e6696e9f8 100644 (file)
@@ -1413,7 +1413,7 @@ out:
        }
        read_unlock(&bond->curr_slave_lock);
        read_unlock(&bond->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 void bond_alb_monitor(struct work_struct *work)
index d927f71af8a31b9096b4ded0f9b18ab47a847116..66596d80b505c7a61ddbf377d3fc66b429c3eb2b 100644 (file)
@@ -4277,7 +4277,7 @@ out:
                dev_kfree_skb(skb);
        }
        read_unlock(&bond->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
@@ -4308,7 +4308,7 @@ out:
 
        read_unlock(&bond->curr_slave_lock);
        read_unlock(&bond->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -4354,7 +4354,7 @@ out:
                dev_kfree_skb(skb);
        }
        read_unlock(&bond->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -4414,7 +4414,7 @@ out:
 
        /* frame sent to all suitable interfaces */
        read_unlock(&bond->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*------------------------- Device initialization ---------------------------*/
index 102b8d4397144bf624ae4ab752fb4f45ab3b3002..b2e0a8fc21d7c7e208a1d335d88845a1ee5ec401 100644 (file)
@@ -3218,7 +3218,7 @@ static int dfx_xmt_queue_pkt(
                bp->xmt_length_errors++;                /* bump error counter */
                netif_wake_queue(dev);
                dev_kfree_skb(skb);
-               return(0);                              /* return "success" */
+               return NETDEV_TX_OK;                    /* return "success" */
        }
        /*
         * See if adapter link is available, if not, free buffer
@@ -3241,7 +3241,7 @@ static int dfx_xmt_queue_pkt(
                        bp->xmt_discards++;                                     /* bump error counter */
                        dev_kfree_skb(skb);             /* free sk_buff now */
                        netif_wake_queue(dev);
-                       return(0);                                                      /* return "success" */
+                       return NETDEV_TX_OK;            /* return "success" */
                        }
                }
 
@@ -3345,7 +3345,7 @@ static int dfx_xmt_queue_pkt(
        dfx_port_write_long(bp, PI_PDQ_K_REG_TYPE_2_PROD, bp->rcv_xmt_reg.lword);
        spin_unlock_irqrestore(&bp->lock, flags);
        netif_wake_queue(dev);
-       return(0);                                                      /* packet queued to adapter */
+       return NETDEV_TX_OK;    /* packet queued to adapter */
        }
 
 
index 97ea2d6d3fe16cc5ac72d68739633d9da8bae637..adb997c5bb5d5c00be102aec70cd98ee15c2e6d9 100644 (file)
@@ -1793,7 +1793,7 @@ static int __init get_hw_addr(struct net_device *dev)
 static int load_packet(struct net_device *dev, struct sk_buff *skb)
 {
        struct depca_private *lp = netdev_priv(dev);
-       int i, entry, end, len, status = 0;
+       int i, entry, end, len, status = NETDEV_TX_OK;
 
        entry = lp->tx_new;     /* Ring around buffer number. */
        end = (entry + (skb->len - 1) / TX_BUFF_SZ) & lp->txRingMask;
index beb84213b6719ba614641e56af5862dd5581ad9e..5443558c439ddac87ab5204b7c7da391721ba906 100644 (file)
@@ -1342,7 +1342,7 @@ static inline int emac_xmit_finish(struct emac_instance *dev, int len)
        ++dev->stats.tx_packets;
        dev->stats.tx_bytes += len;
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* Tx lock BH */
index 96713ef0629848dd1d529246a7b8fe1941f43816..0a79b45178044fd60b87c0d14898ba87bc445eb2 100644 (file)
@@ -164,7 +164,7 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct ifb_private *dp = netdev_priv(dev);
        struct net_device_stats *stats = &dev->stats;
-       int ret = 0;
+       int ret = NETDEV_TX_OK;
        u32 from = G_TC_FROM(skb->tc_verd);
 
        stats->rx_packets++;
index 709835782443610df4103effe32c496548d452b1..f0d0cea6e3297d00468f0670ea878ac777cb8f50 100644 (file)
@@ -1966,10 +1966,10 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
        
        IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
        
-       IRDA_ASSERT(dev != NULL, return 0;);
+       IRDA_ASSERT(dev != NULL, return NETDEV_TX_OK;);
        
        self = netdev_priv(dev);
-       IRDA_ASSERT(self != NULL, return 0;);
+       IRDA_ASSERT(self != NULL, return NETDEV_TX_OK;);
 
        iobase = self->io.sir_base;
 
index 1484c76becfb7addb3ea8bb51d9ab766e88103ca..e4e905698dc728142af49ae11bf652ea5ba94b72 100644 (file)
@@ -981,7 +981,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
 
   self = netdev_priv(dev);
 
-  IRDA_ASSERT (self != NULL, return 0; );
+  IRDA_ASSERT (self != NULL, return NETDEV_TX_OK; );
 
   IRDA_DEBUG (1, "%s.tx:%x(%x)%x\n", __func__
       ,skb->len,self->txpending,INB (OBOE_ENABLEH));
index 05bfc987b34b180dd5e38ca8ceaa7a535265f730..51ca89c9a0ba9c989308ef87e0eb1d5cc7f8f855 100644 (file)
@@ -1365,7 +1365,7 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
        
        self = netdev_priv(dev);
 
-       IRDA_ASSERT(self != NULL, return 0;);
+       IRDA_ASSERT(self != NULL, return NETDEV_TX_OK;);
 
        iobase = self->io.fir_base;
 
index bde004f0a7a342510c5132443966c1a944dceb3c..71dce20e62bed96cb8a3ddc38cfef157520b4ae1 100644 (file)
@@ -590,7 +590,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
        int err;
        s32 speed;
 
-       IRDA_ASSERT(dev != NULL, return 0;);
+       IRDA_ASSERT(dev != NULL, return NETDEV_TX_OK;);
 
        netif_stop_queue(ndev);
 
index d0797adb5f8e7b1eec689fd0e69ae4d1c9ccec37..15f8a7f81600bbd1dc95cca1dfd0d4cb717c6b09 100644 (file)
@@ -886,10 +886,10 @@ static int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
 
        IRDA_DEBUG(1, "%s\n", __func__);
 
-       IRDA_ASSERT(dev != NULL, return 0;);
+       IRDA_ASSERT(dev != NULL, return NETDEV_TX_OK;);
 
        self = netdev_priv(dev);
-       IRDA_ASSERT(self != NULL, return 0;);
+       IRDA_ASSERT(self != NULL, return NETDEV_TX_OK;);
 
        netif_stop_queue(dev);
 
@@ -914,7 +914,7 @@ static int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
                        smsc_ircc_change_speed(self, speed);
                        spin_unlock_irqrestore(&self->lock, flags);
                        dev_kfree_skb(skb);
-                       return 0;
+                       return NETDEV_TX_OK;
                }
                self->new_speed = speed;
        }
@@ -935,7 +935,7 @@ static int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
 
        dev_kfree_skb(skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -1190,9 +1190,9 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
        s32 speed;
        int mtt;
 
-       IRDA_ASSERT(dev != NULL, return 0;);
+       IRDA_ASSERT(dev != NULL, return NETDEV_TX_OK;);
        self = netdev_priv(dev);
-       IRDA_ASSERT(self != NULL, return 0;);
+       IRDA_ASSERT(self != NULL, return NETDEV_TX_OK;);
 
        netif_stop_queue(dev);
 
@@ -1210,7 +1210,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
                        smsc_ircc_change_speed(self, speed);
                        spin_unlock_irqrestore(&self->lock, flags);
                        dev_kfree_skb(skb);
-                       return 0;
+                       return NETDEV_TX_OK;
                }
 
                self->new_speed = speed;
@@ -1242,7 +1242,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
        spin_unlock_irqrestore(&self->lock, flags);
        dev_kfree_skb(skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
index 62ba94ba7c9e3a056fb48041b346ae530cf3f3f3..36a60748447b725f4b5a310c5b5a850ab66e953f 100644 (file)
@@ -832,7 +832,7 @@ static int via_ircc_hard_xmit_sir(struct sk_buff *skb,
        __u32 speed;
 
        self = netdev_priv(dev);
-       IRDA_ASSERT(self != NULL, return 0;);
+       IRDA_ASSERT(self != NULL, return NETDEV_TX_OK;);
        iobase = self->io.fir_base;
 
        netif_stop_queue(dev);
index f28c23343009f26869bcaa8f13f1a0dc85ad54b7..d6be36000c5cf9d0560624fc1c71a1a5b12ee861 100644 (file)
@@ -414,7 +414,7 @@ static int __ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
        dev_kfree_skb (skb);
        dev->stats.tx_bytes += send_length;
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /**
index 08c43f2ae72b0f9fb0ebf4eb08926ceefd5f5fb3..d5c18c674255716f2c2f84c0ebd1046ae42ea51f 100644 (file)
@@ -764,7 +764,7 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Poll CQ here */
        mlx4_en_xmit_poll(priv, tx_ind);
 
-       return 0;
+       return NETDEV_TX_OK;
 
 tx_drop:
        dev_kfree_skb_any(skb);
index 05cd24d0d0c6d20f203894c7de1ec7b73a489cac..1a34f7e11d987c3d081222ab3c899c9dad366100 100644 (file)
@@ -2968,13 +2968,13 @@ static int myri10ge_sw_tso(struct sk_buff *skb, struct net_device *dev)
                }
        }
        dev_kfree_skb_any(skb);
-       return 0;
+       return NETDEV_TX_OK;
 
 drop:
        ss = &mgp->ss[skb_get_queue_mapping(skb)];
        dev_kfree_skb_any(skb);
        ss->stats.tx_dropped += 1;
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static struct net_device_stats *myri10ge_get_stats(struct net_device *dev)
index 77d44a061703437b8ab95bf8138c978a6910859f..a0ac5d4f27d3f3fde47e1e1f3b45987b06fefd4f 100644 (file)
@@ -1183,7 +1183,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        if (skb->len > XMIT_BUFF_SIZE) {
                printk(KERN_ERR "%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n", dev->name, XMIT_BUFF_SIZE, skb->len);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        netif_stop_queue(dev);
@@ -1267,7 +1267,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev)
        }
        dev_kfree_skb(skb);
 #endif
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*******************************************
index 0c31272cf54d142056f714d41e7745d4564d62dd..888a14a045efe5a2572d8d657e1a3c11ec3a345f 100644 (file)
@@ -1077,7 +1077,7 @@ static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev)
                // dequeue packets from xmt queue and send them
                netif_start_queue(dev);
                dev_kfree_skb(skb);
-               return (0);     /* return "success" */
+               return NETDEV_TX_OK;    /* return "success" */
        }
        if (bp->QueueSkb == 0) {        // return with tbusy set: queue full
 
index 753a1fba46093cb4bc076eee92e7de93f06ab4de..9599ce77ef85858fb993d088ef51c483fd3482ed 100644 (file)
@@ -211,7 +211,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
        length = skb->len;
        if (length < ETH_ZLEN) {
                if (skb_padto(skb, ETH_ZLEN))
-                       return 0;
+                       return NETDEV_TX_OK;
                length = ETH_ZLEN;
        }
 
@@ -265,7 +265,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        dev->trans_start = jiffies;
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
index 54ad4ed0337406d9ef46ed3e8a2a4397c8449db0..6515894c83f5397ac5ee879d39f87514134870d9 100644 (file)
@@ -4609,7 +4609,7 @@ static int smctr_send_packet(struct sk_buff *skb, struct net_device *dev)
         if(tp->QueueSkb > 0)
                netif_wake_queue(dev);
                
-        return (0);
+        return NETDEV_TX_OK;
 }
 
 static int smctr_send_lobe_media_test(struct net_device *dev)
index a2eab72b507a6473c4d72d43c2bdc8f3e68bf3a8..07f6dfd3ba0c2774deabe44a375dc40282f51ab6 100644 (file)
@@ -682,7 +682,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device
        tms380tr_exec_sifcmd(dev, CMD_TX_VALID);
        spin_unlock_irqrestore(&tp->lock, flags);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
index 8e78f003f08f6c559f8d1ce12493ef4b9095b58c..5e15fab58c170d9305bcd9a7f4ed1e88205787ab 100644 (file)
@@ -676,7 +676,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
        if (skb->len > MAX_PACKET_SIZE) {
                printk(KERN_ERR DRV_NAME ": big packet = %d\n", (u16)skb->len);
                dev_kfree_skb(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        spin_lock_irqsave(&db->lock, flags);
@@ -722,7 +722,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
        /* free this SKB */
        dev_kfree_skb(skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
index 2fa275a58f9d7f618b8a7d0e5398cda3c38c51c6..8526b6d1ee4da0baac257946f607d005ea1e74c5 100644 (file)
@@ -194,7 +194,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
        ret = 0;
 
        if (!skb || !dev)
-               return(0);
+               return NETDEV_TX_OK;
 
        dlp = netdev_priv(dev);
 
@@ -219,7 +219,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
        /* Alan Cox recommends always returning 0, and always freeing the packet */
        /* experience suggest a slightly more conservative approach */
 
-       if (!ret)
+       if (ret == NETDEV_TX_OK)
        {
                dev_kfree_skb(skb);
                netif_wake_queue(dev);
index 8face5db8f32a132be74c053ccafe6fec25d4ae1..e81946d985431e839693cbaf41415732c6557250 100644 (file)
@@ -1182,7 +1182,7 @@ static int dscc4_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (dscc4_tx_quiescent(dpriv, dev))
                dscc4_do_tx(dpriv, dev);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static int dscc4_close(struct net_device *dev)
index 90c0a317d9d3bca01057627e7bdbe2b9dc5748a9..20a1237a3d743f6b8d8588d35c6a3dfb81235232 100644 (file)
@@ -2294,7 +2294,7 @@ fst_start_xmit(struct sk_buff *skb, struct net_device *dev)
                dbg(DBG_ASS,
                    "Tried to transmit but no carrier on card %d port %d\n",
                    card->card_no, port->index);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        /* Drop it if it's too big! MTU failure ? */
@@ -2303,7 +2303,7 @@ fst_start_xmit(struct sk_buff *skb, struct net_device *dev)
                    LEN_TX_BUFFER);
                dev_kfree_skb(skb);
                dev->stats.tx_errors++;
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        /*
@@ -2337,7 +2337,7 @@ fst_start_xmit(struct sk_buff *skb, struct net_device *dev)
                dev->stats.tx_errors++;
                dbg(DBG_ASS, "Tx queue overflow card %d port %d\n",
                    card->card_no, port->index);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        /*
@@ -2354,7 +2354,7 @@ fst_start_xmit(struct sk_buff *skb, struct net_device *dev)
        fst_q_work_item(&fst_work_txq, card->card_no);
        tasklet_schedule(&fst_tx_task);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
index 45b1822c962dabf212b644092b761ac674264079..d1492ae5d30ad8adff3e1322642eacb33d71ad28 100644 (file)
@@ -1428,7 +1428,7 @@ static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev)
     lmc_softc_t *sc = dev_to_sc(dev);
     u32 flag;
     int entry;
-    int ret = 0;
+    int ret = NETDEV_TX_OK;
     unsigned long flags;
 
     lmc_trace(dev, "lmc_start_xmit in");
index e4ad7b6b52eb2077d5f8e3c30b6c4d98ee253407..03b76adbe5f0ac963aadf1609475deb0f182c5b8 100644 (file)
@@ -310,7 +310,7 @@ static int wanxl_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        spin_unlock(&port->lock);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
index d313b005114e31b4db5496bd81c40865365c7306..1fe1bbabb90749e0b9644df1f5c8010b630bf954 100644 (file)
@@ -75,7 +75,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb "
                       "(len=%d)\n", dev->name, skb->len);
                kfree_skb(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        if (local->ddev != dev) {
@@ -89,14 +89,14 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        printk(KERN_DEBUG "%s: prism2_tx: trying to use "
                               "AP device with Ethernet net dev\n", dev->name);
                        kfree_skb(skb);
-                       return 0;
+                       return NETDEV_TX_OK;
                }
        } else {
                if (local->iw_mode == IW_MODE_REPEAT) {
                        printk(KERN_DEBUG "%s: prism2_tx: trying to use "
                               "non-WDS link in Repeater mode\n", dev->name);
                        kfree_skb(skb);
-                       return 0;
+                       return NETDEV_TX_OK;
                } else if (local->iw_mode == IW_MODE_INFRA &&
                           (local->wds_type & HOSTAP_WDS_AP_CLIENT) &&
                           memcmp(skb->data + ETH_ALEN, dev->dev_addr,
@@ -210,13 +210,13 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                skb = skb_unshare(skb, GFP_ATOMIC);
                if (skb == NULL) {
                        iface->stats.tx_dropped++;
-                       return 0;
+                       return NETDEV_TX_OK;
                }
                if (pskb_expand_head(skb, need_headroom, need_tailroom,
                                     GFP_ATOMIC)) {
                        kfree_skb(skb);
                        iface->stats.tx_dropped++;
-                       return 0;
+                       return NETDEV_TX_OK;
                }
        } else if (skb_headroom(skb) < need_headroom) {
                struct sk_buff *tmp = skb;
@@ -224,13 +224,13 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
                kfree_skb(tmp);
                if (skb == NULL) {
                        iface->stats.tx_dropped++;
-                       return 0;
+                       return NETDEV_TX_OK;
                }
        } else {
                skb = skb_unshare(skb, GFP_ATOMIC);
                if (skb == NULL) {
                        iface->stats.tx_dropped++;
-                       return 0;
+                       return NETDEV_TX_OK;
                }
        }
 
@@ -256,7 +256,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Send IEEE 802.11 encapsulated frame using the master radio device */
        skb->dev = local->dev;
        dev_queue_xmit(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
@@ -276,7 +276,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
                printk(KERN_DEBUG "%s: hostap_mgmt_start_xmit: short skb "
                       "(len=%d)\n", dev->name, skb->len);
                kfree_skb(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        iface->stats.tx_packets++;
@@ -301,7 +301,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Send IEEE 802.11 encapsulated frame using the master radio device */
        skb->dev = local->dev;
        dev_queue_xmit(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
@@ -396,7 +396,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
                printk(KERN_DEBUG "%s: invalid skb->cb magic (0x%08x, "
                       "expected 0x%08x)\n",
                       dev->name, meta->magic, HOSTAP_SKB_TX_DATA_MAGIC);
-               ret = 0;
+               ret = NETDEV_TX_OK;
                iface->stats.tx_dropped++;
                goto fail;
        }
@@ -414,7 +414,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (skb->len < 24) {
                printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb "
                       "(len=%d)\n", dev->name, skb->len);
-               ret = 0;
+               ret = NETDEV_TX_OK;
                iface->stats.tx_dropped++;
                goto fail;
        }
@@ -441,13 +441,13 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
                               dev->name, meta->ethertype);
                        hostap_dump_tx_80211(dev->name, skb);
 
-                       ret = 0; /* drop packet */
+                       ret = NETDEV_TX_OK; /* drop packet */
                        iface->stats.tx_dropped++;
                        goto fail;
                }
                break;
        case AP_TX_DROP:
-               ret = 0; /* drop packet */
+               ret = NETDEV_TX_OK; /* drop packet */
                iface->stats.tx_dropped++;
                goto fail;
        case AP_TX_RETRY:
@@ -455,7 +455,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
        case AP_TX_BUFFERED:
                /* do not free skb here, it will be freed when the
                 * buffered frame is sent/timed out */
-               ret = 0;
+               ret = NETDEV_TX_OK;
                goto tx_exit;
        }
 
@@ -501,7 +501,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
                               "frame (drop_unencrypted=1)\n", dev->name);
                }
                iface->stats.tx_dropped++;
-               ret = 0;
+               ret = NETDEV_TX_OK;
                goto fail;
        }
 
@@ -510,7 +510,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
                if (skb == NULL) {
                        printk(KERN_DEBUG "%s: TX - encryption failed\n",
                               dev->name);
-                       ret = 0;
+                       ret = NETDEV_TX_OK;
                        goto fail;
                }
                meta = (struct hostap_skb_tx_data *) skb->cb;
@@ -519,23 +519,23 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
                               "expected 0x%08x) after hostap_tx_encrypt\n",
                               dev->name, meta->magic,
                               HOSTAP_SKB_TX_DATA_MAGIC);
-                       ret = 0;
+                       ret = NETDEV_TX_OK;
                        iface->stats.tx_dropped++;
                        goto fail;
                }
        }
 
        if (local->func->tx == NULL || local->func->tx(skb, dev)) {
-               ret = 0;
+               ret = NETDEV_TX_OK;
                iface->stats.tx_dropped++;
        } else {
-               ret = 0;
+               ret = NETDEV_TX_OK;
                iface->stats.tx_packets++;
                iface->stats.tx_bytes += skb->len;
        }
 
  fail:
-       if (!ret && skb)
+       if (ret == NETDEV_TX_OK && skb)
                dev_kfree_skb(skb);
  tx_exit:
        if (tx.sta_ptr)
index da2ad5437ce5b3f74db5c8230ed8f92430262d31..2e8f84fb29fa3eebc9a315c9d7363a4ceee8cbe4 100644 (file)
@@ -527,13 +527,13 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
                if (ret == 0) {
                        dev->stats.tx_packets++;
                        dev->stats.tx_bytes += txb->payload_size;
-                       return 0;
+                       return NETDEV_TX_OK;
                }
 
                ieee80211_txb_free(txb);
        }
 
-       return 0;
+       return NETDEV_TX_OK;
 
       failed:
        spin_unlock_irqrestore(&ieee->lock, flags);
index 8f6210993448db6d69b26b02bd5100dd52a73a12..c255d9c6a5f1b7ad74610a8d0fafe69980e8e73f 100644 (file)
@@ -234,7 +234,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
        /* unlock the driver code */
        spin_unlock_irqrestore(&priv->slock, flags);
 
-       return 0;
+       return NETDEV_TX_OK;
 
       drop_free:
        ndev->stats.tx_dropped++;
index ab7fc5c0c8b4e46a64f71083ebdbffbe141593fc..5cb5329a20d112bb5abed039e177e7122cec6572 100644 (file)
@@ -2891,7 +2891,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
 #ifdef DEBUG_TX_TRACE
        printk(KERN_DEBUG "%s: <-wavelan_packet_xmit()\n", dev->name);
 #endif
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*********************** HARDWARE CONFIGURATION ***********************/
index 6af706408ac08bf252a4a97105af0379734db621..9dd241adc379821526da9cc38da1d07e84cfa90b 100644 (file)
@@ -3113,7 +3113,7 @@ wavelan_packet_xmit(struct sk_buff *      skb,
         * able to detect collisions, therefore in theory we don't really
         * need to pad. Jean II */
        if (skb_padto(skb, ETH_ZLEN))
-               return 0;
+               return NETDEV_TX_OK;
 
   wv_packet_write(dev, skb->data, skb->len);
 
@@ -3122,7 +3122,7 @@ wavelan_packet_xmit(struct sk_buff *      skb,
 #ifdef DEBUG_TX_TRACE
   printk(KERN_DEBUG "%s: <-wavelan_packet_xmit()\n", dev->name);
 #endif
-  return(0);
+  return NETDEV_TX_OK;
 }
 
 /********************** HARDWARE CONFIGURATION **********************/
index e3e96bb2c246bed6905bf9a0d48835668a6fdab8..a83a5621ec44595f1db79c205e202b851a0f529d 100644 (file)
@@ -1348,7 +1348,6 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (rc) {
                ++dev->stats.tx_dropped;
                netif_stop_queue(dev);
-               rc = NETDEV_TX_OK;
        } else {
                ++dev->stats.tx_packets;
                dev->stats.tx_bytes += skb->len;
@@ -1358,7 +1357,7 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        netif_stop_queue(dev);
        }
        spin_unlock_irqrestore(&this->lock, flags);
-       return rc;
+       return NETDEV_TX_OK;
 }
 
 static int wl3501_open(struct net_device *dev)
index f370f8d460a721674f5537d79c8e528d23bb4b5e..c63babefb69840be3ce38244b363aaec18c99479 100644 (file)
@@ -350,6 +350,8 @@ claw_tx(struct sk_buff *skb, struct net_device *dev)
        CLAW_DBF_TEXT_(4, trace, "clawtx%d", rc);
        if (rc)
                rc = NETDEV_TX_BUSY;
+       else
+               rc = NETDEV_TX_OK;
         return rc;
 }   /*  end of claw_tx */
 
index 8c675905448b74c33983c7e5038e4b8688a15ce0..a70de9b4bf2929938fd5f081673f19a8e0d61d42 100644 (file)
@@ -1553,24 +1553,24 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
                 struct net_device *dev)
 {
        struct lcs_header *header;
-       int rc = 0;
+       int rc = NETDEV_TX_OK;
 
        LCS_DBF_TEXT(5, trace, "hardxmit");
        if (skb == NULL) {
                card->stats.tx_dropped++;
                card->stats.tx_errors++;
-               return 0;
+               return NETDEV_TX_OK;
        }
        if (card->state != DEV_STATE_UP) {
                dev_kfree_skb(skb);
                card->stats.tx_dropped++;
                card->stats.tx_errors++;
                card->stats.tx_carrier_errors++;
-               return 0;
+               return NETDEV_TX_OK;
        }
        if (skb->protocol == htons(ETH_P_IPV6)) {
                dev_kfree_skb(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
        netif_stop_queue(card->dev);
        spin_lock(&card->lock);
index 8c36eafcfbfeb5957460196f4fca9a387ca2bdbb..bb1183a2ed66f43e93d8b39a4f21e00422616533 100644 (file)
@@ -1376,14 +1376,14 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
        if (skb == NULL) {
                IUCV_DBF_TEXT(data, 2, "netiucv_tx: skb is NULL\n");
                privptr->stats.tx_dropped++;
-               return 0;
+               return NETDEV_TX_OK;
        }
        if (skb_headroom(skb) < NETIUCV_HDRLEN) {
                IUCV_DBF_TEXT(data, 2,
                        "netiucv_tx: skb_headroom < NETIUCV_HDRLEN\n");
                dev_kfree_skb(skb);
                privptr->stats.tx_dropped++;
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        /**
@@ -1395,7 +1395,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
                privptr->stats.tx_dropped++;
                privptr->stats.tx_errors++;
                privptr->stats.tx_carrier_errors++;
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        if (netiucv_test_and_set_busy(dev)) {
index 691cecd03b837ab85eefb8dfe04dbb9adf228cc8..2cfc338c4625ca2b94b73745a0c1d5650668cddb 100644 (file)
@@ -744,6 +744,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                card->stats.tx_bytes += tx_bytes;
                if (new_skb != skb)
                        dev_kfree_skb_any(skb);
+               rc = NETDEV_TX_OK;
        } else {
                if (data_offset >= 0)
                        kmem_cache_free(qeth_core_header_cache, hdr);
index 54872406864e006bcccfb75549b2ffd39ed1f180..048defaea81fad8bcd598547ec037e7990227e68 100644 (file)
@@ -2793,6 +2793,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                                card->perf_stats.sg_frags_sent += nr_frags + 1;
                        }
                }
+               rc = NETDEV_TX_OK;
        } else {
                if (data_offset >= 0)
                        kmem_cache_free(qeth_core_header_cache, hdr);
index f298b9bcec391f21f08140924c8d9368919ebd2a..35c59d5aa99cef42c07e1a5f966cf8c229d4480f 100644 (file)
@@ -862,7 +862,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb)
 {
        struct net_device *net_dev = skb->dev;
        PRTMP_ADAPTER pAd = net_dev->ml_priv;
-       int status = 0;
+       int status = NETDEV_TX_OK;
        PNDIS_PACKET pPacket = (PNDIS_PACKET) skb;
 
        {
@@ -892,7 +892,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb)
 
        STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1);
 
-       status = 0;
+       status = NETDEV_TX_OK;
 done:
 
        return status;
@@ -923,7 +923,7 @@ INT rt28xx_send_packets(
        if (!(net_dev->flags & IFF_UP))
        {
                RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        NdisZeroMemory((PUCHAR)&skb_p->cb[CB_OFF], 15);
index 1294e05fcf1356670eef223e55fc8da94c025f8b..1b774601b4a33a51a662414c0ac44ca8aa9c9576 100644 (file)
@@ -802,13 +802,13 @@ int ieee80211_xmit(struct sk_buff *skb,
                        if ((*ieee->hard_start_xmit)(txb, dev) == 0) {
                                stats->tx_packets++;
                                stats->tx_bytes += txb->payload_size;
-                               return 0;
+                               return NETDEV_TX_OK;
                        }
                        ieee80211_txb_free(txb);
                }
        }
 
-       return 0;
+       return NETDEV_TX_OK;
 
  failed:
        spin_unlock_irqrestore(&ieee->lock, flags);
index 7e2fecae813c066b44ac01c1f1f4f2c7f05fa9d9..26a59118d34c3f58e37432ffbd88818fb4bfc7bc 100644 (file)
@@ -3040,7 +3040,7 @@ int rtl8180_hard_start_xmit(struct sk_buff *skb,struct net_device *dev)
                spin_unlock_irqrestore(&priv->tx_lock,flags);
 
                dev_kfree_skb_any(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
        rtl8180_tx(dev, skb->data, skb->len, priority,
@@ -3051,7 +3051,7 @@ int rtl8180_hard_start_xmit(struct sk_buff *skb,struct net_device *dev)
        spin_unlock_irqrestore(&priv->tx_lock,flags);
 
        dev_kfree_skb_any(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 // longpre 144+48 shortpre 72+24
index 90f499e00dc59e9d28a059b8c190dfb6e81fcd7c..c273c034a830dd776d4628554790dde7a86696ab 100644 (file)
@@ -354,7 +354,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
        p80211_metawep_t p80211_wep;
 
        if (skb == NULL)
-               return 0;
+               return NETDEV_TX_OK;
 
        if (wlandev->state != WLAN_DEVICE_OPEN) {
                result = 1;
index e5bf11453a18b60b7b30ac2a4f3aea91ff60e978..1ac4b94bf6266bcf036e663d113933aecd83a6a0 100644 (file)
@@ -554,7 +554,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
        while (i < mpc->number_of_mps_macs) {
                if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN)))
                        if ( send_via_shortcut(skb, mpc) == 0 )           /* try shortcut */
-                               return 0;                                 /* success!     */
+                               return NETDEV_TX_OK;                      /* success!     */
                i++;
        }
 
index 70c27e0c7c3235a8df94d27f6080248d6b000239..dca8b5000d3b2dbc25389dae43a2372c4e4a8da4 100644 (file)
@@ -1704,7 +1704,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
                        skb_dst_drop(skb);
 
                rc = ops->ndo_start_xmit(skb, dev);
-               if (rc == 0)
+               if (rc == NETDEV_TX_OK)
                        txq_trans_update(txq);
                /*
                 * TODO: if skb_orphan() was called by
@@ -1730,7 +1730,7 @@ gso:
                skb->next = nskb->next;
                nskb->next = NULL;
                rc = ops->ndo_start_xmit(nskb, dev);
-               if (unlikely(rc)) {
+               if (unlikely(rc != NETDEV_TX_OK)) {
                        nskb->next = skb->next;
                        skb->next = nskb;
                        return rc;
@@ -1744,7 +1744,7 @@ gso:
 
 out_kfree_skb:
        kfree_skb(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static u32 skb_tx_hashrnd;
index d238a8939a094de63e1f9782a68b908a4340b998..2ffb35d3f56649d0a7ddaf640a690db8b380c450 100644 (file)
@@ -1627,7 +1627,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
        u32 sta_flags = 0;
 
        if (unlikely(skb->len < ETH_HLEN)) {
-               ret = 0;
+               ret = NETDEV_TX_OK;
                goto fail;
        }
 
@@ -1664,7 +1664,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
                if (!sdata->u.mesh.mshcfg.dot11MeshTTL) {
                        /* Do not send frames with mesh_ttl == 0 */
                        sdata->u.mesh.mshstats.dropped_frames_ttl++;
-                       ret = 0;
+                       ret = NETDEV_TX_OK;
                        goto fail;
                }
                memset(&mesh_hdr, 0, sizeof(mesh_hdr));
@@ -1724,7 +1724,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
                hdrlen = 24;
                break;
        default:
-               ret = 0;
+               ret = NETDEV_TX_OK;
                goto fail;
        }
 
@@ -1766,7 +1766,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
 
                I802_DEBUG_INC(local->tx_handlers_drop_unauth_port);
 
-               ret = 0;
+               ret = NETDEV_TX_OK;
                goto fail;
        }
 
@@ -1858,10 +1858,10 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
        dev->trans_start = jiffies;
        dev_queue_xmit(skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 
  fail:
-       if (!ret)
+       if (ret == NETDEV_TX_OK)
                dev_kfree_skb(skb);
 
        return ret;