Commit f5588912 authored by Varka Bhadram's avatar Varka Bhadram Committed by Marcel Holtmann

mac802154: common tx error path

This patch introduce the common error path on failure of Tx by
inserting the label 'err_tx'.
Signed-off-by: default avatarVarka Bhadram <varkab@cdac.in>
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 0ba1f94e
...@@ -89,8 +89,7 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -89,8 +89,7 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
if (!(priv->phy->channels_supported[page] & (1 << chan))) { if (!(priv->phy->channels_supported[page] & (1 << chan))) {
WARN_ON(1); WARN_ON(1);
kfree_skb(skb); goto err_tx;
return NETDEV_TX_OK;
} }
mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb); mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb);
...@@ -103,12 +102,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -103,12 +102,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
data[1] = crc >> 8; data[1] = crc >> 8;
} }
if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) { if (skb_cow_head(skb, priv->hw.extra_tx_headroom))
kfree_skb(skb); goto err_tx;
return NETDEV_TX_OK;
}
work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC); work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (!work) { if (!work) {
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
...@@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
queue_work(priv->dev_workqueue, &work->work); queue_work(priv->dev_workqueue, &work->work);
return NETDEV_TX_OK; return NETDEV_TX_OK;
err_tx:
kfree_skb(skb);
return NETDEV_TX_OK;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment