summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl8187_dev.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-20 20:34:22 -0700
committerDavid S. Miller <davem@davemloft.net>2008-05-20 20:34:22 -0700
commitd8ac48d4cbae0cc59b7784399292fbda3e231be3 (patch)
tree9fc0adc5c8685e13f2b7208687ae409a98c3f99c /drivers/net/wireless/rtl8187_dev.c
parentd3ede327e83f202c3a0962e207318f65717c5eb7 (diff)
parent5d283e8cdb8097b6a3e9304c9c8942ad9dc1a4eb (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers/net/wireless/rtl8187_dev.c')
-rw-r--r--drivers/net/wireless/rtl8187_dev.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index d5787b37e1f..9223ada5f00 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -92,6 +92,7 @@ static void rtl8187_iowrite_async(struct rtl8187_priv *priv, __le16 addr,
u8 data[4];
struct usb_ctrlrequest dr;
} *buf;
+ int rc;
buf = kmalloc(sizeof(*buf), GFP_ATOMIC);
if (!buf)
@@ -116,7 +117,11 @@ static void rtl8187_iowrite_async(struct rtl8187_priv *priv, __le16 addr,
usb_fill_control_urb(urb, priv->udev, usb_sndctrlpipe(priv->udev, 0),
(unsigned char *)dr, buf, len,
rtl8187_iowrite_async_cb, buf);
- usb_submit_urb(urb, GFP_ATOMIC);
+ rc = usb_submit_urb(urb, GFP_ATOMIC);
+ if (rc < 0) {
+ kfree(buf);
+ usb_free_urb(urb);
+ }
}
static inline void rtl818x_iowrite32_async(struct rtl8187_priv *priv,
@@ -169,6 +174,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
struct urb *urb;
__le16 rts_dur = 0;
u32 flags;
+ int rc;
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) {
@@ -208,7 +214,11 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
info->dev = dev;
usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2),
hdr, skb->len, rtl8187_tx_cb, skb);
- usb_submit_urb(urb, GFP_ATOMIC);
+ rc = usb_submit_urb(urb, GFP_ATOMIC);
+ if (rc < 0) {
+ usb_free_urb(urb);
+ kfree_skb(skb);
+ }
return 0;
}