* [patch] resource leak in error case in rtl8187
@ 2008-05-15 14:17 Oliver Neukum
[not found] ` <200805151617.37968.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Neukum @ 2008-05-15 14:17 UTC (permalink / raw)
To: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
Michael Wu, Andrea Merello
Hi,
this fixes a resource leak in the error case of the write code path.
Regards
Oliver
Signed-off-by: Oliver Neukum <oneukum-l3A5Bk7waGM@public•gmane.org>
---
--- linux-2.6.26-rc1/drivers/net/wireless/rtl8187_dev.c.alt 2008-05-15 15:53:58.000000000 +0200
+++ linux-2.6.26-rc1/drivers/net/wireless/rtl8187_dev.c 2008-05-15 15:57:35.000000000 +0200
@@ -169,6 +169,7 @@ static int rtl8187_tx(struct ieee80211_h
struct 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <200805151617.37968.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>]
* Re: [patch] resource leak in error case in rtl8187 [not found] ` <200805151617.37968.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org> @ 2008-05-15 18:57 ` John W. Linville [not found] ` <20080515185724.GA17690-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: John W. Linville @ 2008-05-15 18:57 UTC (permalink / raw) To: Oliver Neukum Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA, Michael Wu, Andrea Merello On Thu, May 15, 2008 at 04:17:36PM +0200, Oliver Neukum wrote: > Hi, > > this fixes a resource leak in the error case of the write code path. > > Regards > Oliver > > Signed-off-by: Oliver Neukum <oneukum-l3A5Bk7waGM@public•gmane.org> > > --- > > --- linux-2.6.26-rc1/drivers/net/wireless/rtl8187_dev.c.alt 2008-05-15 15:53:58.000000000 +0200 > +++ linux-2.6.26-rc1/drivers/net/wireless/rtl8187_dev.c 2008-05-15 15:57:35.000000000 +0200 > @@ -169,6 +169,7 @@ static int rtl8187_tx(struct ieee80211_h > struct 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; > } 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 -- John W. Linville linville-2XuSBdqkA4R54TAoqtyWWQ@public•gmane.org -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20080515185724.GA17690-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>]
* Re: [patch] resource leak in error case in rtl8187 [not found] ` <20080515185724.GA17690-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> @ 2008-05-15 19:46 ` Oliver Neukum 0 siblings, 0 replies; 3+ messages in thread From: Oliver Neukum @ 2008-05-15 19:46 UTC (permalink / raw) To: John W. Linville Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA, Michael Wu, Andrea Merello Am Donnerstag 15 Mai 2008 20:57:24 schrieb John W. Linville: > 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? 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-15 19:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 14:17 [patch] resource leak in error case in rtl8187 Oliver Neukum
[not found] ` <200805151617.37968.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2008-05-15 18:57 ` John W. Linville
[not found] ` <20080515185724.GA17690-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2008-05-15 19:46 ` Oliver Neukum
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox