提交 16d3659f 编写于 作者: P Pekka Enberg 提交者: Greg Kroah-Hartman

Staging: w35und: plug memory leak in wbsoft_tx()

There's no reason to duplicate the skb in wbsoft_tx() and leak GFP_ATOMIC
memory as the contents are copied to ->TxBuffer in MdxTx() anyway before
MLMESendFrame() returns.
Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: NPavel Machek <pavel@suse.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 3c01ec0d
...@@ -107,11 +107,8 @@ static void wbsoft_configure_filter(struct ieee80211_hw *dev, ...@@ -107,11 +107,8 @@ static void wbsoft_configure_filter(struct ieee80211_hw *dev,
static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb) static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
{ {
char *buffer = kmalloc(skb->len, GFP_ATOMIC); MLMESendFrame(my_adapter, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);
printk("Sending frame %d bytes\n", skb->len);
memcpy(buffer, skb->data, skb->len);
if (1 == MLMESendFrame(my_adapter, buffer, skb->len, FRAME_TYPE_802_11_MANAGEMENT))
printk("frame sent ok (%d bytes)?\n", skb->len);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册