diff options
Diffstat (limited to 'net/mac802154/tx.c')
-rw-r--r-- | net/mac802154/tx.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c index 8124353646ae..fdf4c0e67259 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, | |||
89 | 89 | ||
90 | if (!(priv->phy->channels_supported[page] & (1 << chan))) { | 90 | if (!(priv->phy->channels_supported[page] & (1 << chan))) { |
91 | WARN_ON(1); | 91 | WARN_ON(1); |
92 | kfree_skb(skb); | 92 | goto err_tx; |
93 | return NETDEV_TX_OK; | ||
94 | } | 93 | } |
95 | 94 | ||
96 | mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb); | 95 | 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 | data[1] = crc >> 8; | 102 | data[1] = crc >> 8; |
104 | } | 103 | } |
105 | 104 | ||
106 | if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) { | 105 | if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) |
107 | kfree_skb(skb); | 106 | goto err_tx; |
108 | return NETDEV_TX_OK; | ||
109 | } | ||
110 | 107 | ||
111 | work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC); | 108 | work = kzalloc(sizeof(*work), GFP_ATOMIC); |
112 | if (!work) { | 109 | if (!work) { |
113 | kfree_skb(skb); | 110 | kfree_skb(skb); |
114 | return NETDEV_TX_BUSY; | 111 | return NETDEV_TX_BUSY; |
@@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, | |||
129 | queue_work(priv->dev_workqueue, &work->work); | 126 | queue_work(priv->dev_workqueue, &work->work); |
130 | 127 | ||
131 | return NETDEV_TX_OK; | 128 | return NETDEV_TX_OK; |
129 | |||
130 | err_tx: | ||
131 | kfree_skb(skb); | ||
132 | return NETDEV_TX_OK; | ||
132 | } | 133 | } |