Skip to content

Commit

Permalink
mac802154: common tx error path
Browse files Browse the repository at this point in the history
This patch introduce the common error path on failure of Tx by
inserting the label 'err_tx'.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Varka Bhadram authored and Marcel Holtmann committed Aug 14, 2014
1 parent 0ba1f94 commit f558891
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions net/mac802154/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
WARN_ON(1);
kfree_skb(skb);
return NETDEV_TX_OK;
goto err_tx;
}

mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb);
Expand All @@ -103,12 +102,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
data[1] = crc >> 8;
}

if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) {
kfree_skb(skb);
return NETDEV_TX_OK;
}
if (skb_cow_head(skb, priv->hw.extra_tx_headroom))
goto err_tx;

work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC);
work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (!work) {
kfree_skb(skb);
return NETDEV_TX_BUSY;
Expand All @@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
queue_work(priv->dev_workqueue, &work->work);

return NETDEV_TX_OK;

err_tx:
kfree_skb(skb);
return NETDEV_TX_OK;
}

0 comments on commit f558891

Please sign in to comment.