summaryrefslogtreecommitdiffstats
path: root/net/mac802154/tx.c
diff options
context:
space:
mode:
authorAlan Ott <alan@signal11.us>2012-11-29 18:25:10 +0000
committerDavid S. Miller <davem@davemloft.net>2012-11-30 12:19:24 -0500
commitfcefbe9fcb3b0d72c91629f7fcf7ea09a46ab2c1 (patch)
tree7b68000fe15086df2037cf4dbb89242b77257a7f /net/mac802154/tx.c
parentb333b7e6ec210412be49d1dc67b62d4e565a0cd6 (diff)
downloadop-kernel-dev-fcefbe9fcb3b0d72c91629f7fcf7ea09a46ab2c1.zip
op-kernel-dev-fcefbe9fcb3b0d72c91629f7fcf7ea09a46ab2c1.tar.gz
mac802154: fix memory leaks
kfree_skb() was not getting called in the case of some failures. This was pointed out by Eric Dumazet. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac802154/tx.c')
-rw-r--r--net/mac802154/tx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 1a4df39..db63914 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -85,6 +85,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;
}
@@ -103,8 +104,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
}
work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC);
- if (!work)
+ if (!work) {
+ kfree_skb(skb);
return NETDEV_TX_BUSY;
+ }
INIT_WORK(&work->work, mac802154_xmit_worker);
work->skb = skb;
OpenPOWER on IntegriCloud