aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/chnl_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/caif/chnl_net.c')
-rw-r--r--net/caif/chnl_net.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c
index 20618dd3088b..d09340e1523f 100644
--- a/net/caif/chnl_net.c
+++ b/net/caif/chnl_net.c
@@ -103,6 +103,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
103 skb->protocol = htons(ETH_P_IPV6); 103 skb->protocol = htons(ETH_P_IPV6);
104 break; 104 break;
105 default: 105 default:
106 kfree_skb(skb);
106 priv->netdev->stats.rx_errors++; 107 priv->netdev->stats.rx_errors++;
107 return -EINVAL; 108 return -EINVAL;
108 } 109 }
@@ -220,14 +221,16 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
220 221
221 if (skb->len > priv->netdev->mtu) { 222 if (skb->len > priv->netdev->mtu) {
222 pr_warn("Size of skb exceeded MTU\n"); 223 pr_warn("Size of skb exceeded MTU\n");
224 kfree_skb(skb);
223 dev->stats.tx_errors++; 225 dev->stats.tx_errors++;
224 return -ENOSPC; 226 return NETDEV_TX_OK;
225 } 227 }
226 228
227 if (!priv->flowenabled) { 229 if (!priv->flowenabled) {
228 pr_debug("dropping packets flow off\n"); 230 pr_debug("dropping packets flow off\n");
231 kfree_skb(skb);
229 dev->stats.tx_dropped++; 232 dev->stats.tx_dropped++;
230 return NETDEV_TX_BUSY; 233 return NETDEV_TX_OK;
231 } 234 }
232 235
233 if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP) 236 if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP)
@@ -242,7 +245,7 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
242 result = priv->chnl.dn->transmit(priv->chnl.dn, pkt); 245 result = priv->chnl.dn->transmit(priv->chnl.dn, pkt);
243 if (result) { 246 if (result) {
244 dev->stats.tx_dropped++; 247 dev->stats.tx_dropped++;
245 return result; 248 return NETDEV_TX_OK;
246 } 249 }
247 250
248 /* Update statistics. */ 251 /* Update statistics. */