Skip to content

Commit

Permalink
Staging: w35und: plug memory leak in wbsoft_tx()
Browse files Browse the repository at this point in the history
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: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pekka Enberg authored and Greg Kroah-Hartman committed Jan 6, 2009
1 parent 3c01ec0 commit 16d3659
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/staging/winbond/linux/wbusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
char *buffer = kmalloc(skb->len, GFP_ATOMIC);
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);
MLMESendFrame(my_adapter, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);

return NETDEV_TX_OK;
}

Expand Down

0 comments on commit 16d3659

Please sign in to comment.