netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
To: oneukum-l3A5Bk7waGM@public.gmane.org
Cc: ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org,
	grundler-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	freddy-knRN6Y/kmf1NUHwG+Fw1Kw@public.gmane.org,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org
Subject: Re: [PATCH v1 3/4] USBNET: support DMA SG
Date: Sat, 03 Aug 2013 12:07:31 -0700 (PDT)	[thread overview]
Message-ID: <20130803.120731.1813304058291781420.davem@davemloft.net> (raw)
In-Reply-To: <1375509413.2201.2.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>

From: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
Date: Sat, 03 Aug 2013 07:56:53 +0200

> On Sat, 2013-08-03 at 10:46 +0800, Ming Lei wrote:
> 
>> @@ -1268,10 +1298,14 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
>>  	entry = (struct skb_data *) skb->cb;
>>  	entry->urb = urb;
>>  	entry->dev = dev;
>> -	entry->length = length;
>>  
>>  	usb_fill_bulk_urb (urb, dev->udev, dev->out,
>>  			skb->data, skb->len, tx_complete, skb);
>> +	if (dev->can_dma_sg) {
>> +		if (build_dma_sg(skb, urb) < 0)
>> +			goto drop;
> 
> Where do you free urb->sg?

Indeed, this appears to leak.

The devio.c code in the USB layer takes care to manage freeing of
the urb->sg, so this usbnet code will have to as well.
--
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

  parent reply	other threads:[~2013-08-03 19:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-03  2:46 [PATCH v1 0/4] USB & USBNET: loose SG check and support usbnet DMA SG Ming Lei
2013-08-03  2:46 ` [PATCH v1 1/4] USB: introduce usb_device_no_sg_limit() helper Ming Lei
2013-08-03 15:53   ` Alan Stern
2013-08-04  0:22     ` Ming Lei
2013-08-03  2:46 ` [PATCH v1 2/4] USB: XHCI: mark no_sg_limit Ming Lei
2013-08-03  2:46 ` [PATCH v1 3/4] USBNET: support DMA SG Ming Lei
     [not found]   ` <1375497998-7424-4-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-08-03  5:56     ` Oliver Neukum
     [not found]       ` <1375509413.2201.2.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2013-08-03 19:07         ` David Miller [this message]
2013-08-04  0:19           ` Ming Lei
2013-08-03  2:46 ` [PATCH v1 4/4] USBNET: ax88179_178a: enable tso if usb host supports sg dma Ming Lei
2013-08-04  0:28 ` [PATCH v1 0/4] USB & USBNET: loose SG check and support usbnet DMA SG Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130803.120731.1813304058291781420.davem@davemloft.net \
    --to=davem-ft/pcqaiutieiz0/mpfg9q@public.gmane.org \
    --cc=bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org \
    --cc=eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=freddy-knRN6Y/kmf1NUHwG+Fw1Kw@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=grundler-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oneukum-l3A5Bk7waGM@public.gmane.org \
    --cc=sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).