resource leak in error case in rtl8187
Subsystems (3)
PATCH 1/1 resource leak in error case in rtl8187
Hi,
this fixes a resource leak in the error case of the write code path.
Regards
Oliver
---
drivers/net/wireless/rtl8187_dev.c renamed from drivers/net/wireless/rtl8187_dev.c.alt +6 -1
@@ -169,6 +169,7 @@ static int rtl8187_tx(struct ieee80211_hstruct urb *urb;__le16 rts_dur =0 ;u32 flags; +int rv; urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!urb) {
@@ -208,7 +209,11 @@ static int rtl8187_tx(struct ieee80211_h 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 ); + rv =usb_submit_urb (urb,GFP_ATOMIC ); +if (rv <0 ) { +usb_free_urb (urb); +kfree_skb (skb); + }return 0 ; }
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 200805151617.37968.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org
Quoted 24 lines · Oliver Neukum
Hi,
this fixes a resource leak in the error case of the write code path.
Regards
OliverSigned-off-by Oliver Neukum <[email protected]>---
drivers/net/wireless/rtl8187_dev.c renamed from drivers/net/wireless/rtl8187_dev.c.alt +1
-0@@ -169,6 +169,7 @@ static int rtl8187_tx(struct ieee80211_hstruct urb *urb;__le16 rts_dur =0 ;u32 flags; +int rv; urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!urb) {@@ -208,7 +209,11 @@ static int rtl8187_tx(struct ieee80211_h info->dev = dev; usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2),
drivers/net/wireless/rtl8187_dev.c static int rtl8187_tx(struct ieee80211_h · line 219
Quoted 10 lines
drivers/net/wireless/rtl8187_dev.c renamed from drivers/net/wireless/rtl8187_dev.c.alt +5
-1hdr, skb->len, rtl8187_tx_cb, skb); -usb_submit_urb (urb,GFP_ATOMIC ); + rv =usb_submit_urb (urb,GFP_ATOMIC ); +if (rv <0 ) { +usb_free_urb (urb); +kfree_skb (skb); + }return 0 ; }
Don't we need the same type of fix applied to rtl8187_iowrite_async as well? Would you like to resubmit (or submit a second patch) with that fix included?
Also, a nit: I would prefer "rc" instead of "rv" just for idiomatic purposes.
John
Signature · 6 lines
John W. Linville [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Am Donnerstag 15 Mai 2008 20:57:24 schrieb John W. Linville:
Quoted 3 lines
Don't we need the same type of fix applied to
rtl8187_iowrite_asyncas well? Would you like to resubmit (or submit a second patch) with that fix included?
Indeed. A new redone patch is on the way. Please disregard the earlier patch.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html