mac802154: tx: fix error handling while xmit
authorAlexander Aring <alex.aring@gmail.com>
Sun, 26 Oct 2014 08:37:07 +0000 (09:37 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 26 Oct 2014 16:24:04 +0000 (17:24 +0100)
In case of an error we should call kfree_skb instead of consume_skb which
is called by ieee802154_xmit_complete function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/mac802154/tx.c

index 8e2f429a4546d89569ec29014e8bc92bd618bf2b..23139cae076499d858e74f2c60fbb9f46af53318 100644 (file)
@@ -51,11 +51,15 @@ static void mac802154_xmit_worker(struct work_struct *work)
        int res;
 
        res = local->ops->xmit(&local->hw, skb);
-       if (res)
+       if (res) {
                pr_debug("transmission failed\n");
-
-       /* Restart the netif queue on each sub_if_data object. */
-       ieee802154_xmit_complete(&local->hw, skb);
+               /* Restart the netif queue on each sub_if_data object. */
+               ieee802154_wake_queue(&local->hw);
+               kfree_skb(skb);
+       } else {
+               /* Restart the netif queue on each sub_if_data object. */
+               ieee802154_xmit_complete(&local->hw, skb);
+       }
 }
 
 static netdev_tx_t