summaryrefslogtreecommitdiffstats
path: root/net/mac802154/tx.c
diff options
context:
space:
mode:
authorVarka Bhadram <varkab@cdac.in>2014-08-11 13:25:10 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-08-14 08:49:25 +0200
commitf55889128a776b51581394b20abd0b470304cf95 (patch)
tree459042059218e28f568d4793e7b73a31b333989d /net/mac802154/tx.c
parent0ba1f94e72b811215ce2f4610fe0f6cf88f4b28a (diff)
downloadop-kernel-dev-f55889128a776b51581394b20abd0b470304cf95.zip
op-kernel-dev-f55889128a776b51581394b20abd0b470304cf95.tar.gz
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: Varka Bhadram <varkab@cdac.in> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/tx.c')
-rw-r--r--net/mac802154/tx.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 8124353..fdf4c0e6 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -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);
@@ -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;
@@ -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;
}
OpenPOWER on IntegriCloud