All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Jan Steinhoff <mail@jan-steinhoff.de>,
	Alessandro Rubini <rubini@ipvvis.unipv.it>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: Synaptics USB device driver
Date: Wed, 4 Jan 2012 10:20:41 +0100	[thread overview]
Message-ID: <201201041020.41795.oneukum@suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1201040954000.24984@pobox.suse.cz>

Am Mittwoch, 4. Januar 2012, 09:55:19 schrieb Jiri Kosina:
> On Tue, 3 Jan 2012, Jan Steinhoff wrote:
> 
> [ ... snip ... ]
> > +static int synusb_setup_iurb(struct synusb *synusb,
> > +                          struct usb_endpoint_descriptor *endpoint)
> > +{
> > +     char *buf;
> > +
> > +     if (endpoint->wMaxPacketSize < 8)
> > +             return 0;
> > +     if (synusb->iurb) {
> > +             synusb_warn(synusb, "Found more than one possible "
> > +                                 "int in endpoint");
> > +             return 0;
> > +     }
> > +     synusb->iurb = usb_alloc_urb(0, GFP_KERNEL);
> > +     if (synusb->iurb == NULL)
> > +             return -ENOMEM;
> > +     buf = usb_alloc_coherent(synusb->udev, 8, GFP_ATOMIC,
> > +                              &synusb->iurb->transfer_dma);
> > +     if (buf == NULL)
> > +             return -ENOMEM;
> 
> You seem to leak synusb->iurb here.

Seems so, but doesn't. It gets freed when the refcount hits 0.
Now, whether this is a good technique is another question.

	Regards
		Oliver
-- 
- - - 
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 
Maxfeldstraße 5                         
90409 Nürnberg 
Germany 
- - - 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Oliver Neukum <oneukum@suse.de>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Jan Steinhoff <mail@jan-steinhoff.de>,
	Alessandro Rubini <rubini@cvml.unipv.it>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: Synaptics USB device driver
Date: Wed, 4 Jan 2012 10:20:41 +0100	[thread overview]
Message-ID: <201201041020.41795.oneukum@suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1201040954000.24984@pobox.suse.cz>

Am Mittwoch, 4. Januar 2012, 09:55:19 schrieb Jiri Kosina:
> On Tue, 3 Jan 2012, Jan Steinhoff wrote:
> 
> [ ... snip ... ]
> > +static int synusb_setup_iurb(struct synusb *synusb,
> > +                          struct usb_endpoint_descriptor *endpoint)
> > +{
> > +     char *buf;
> > +
> > +     if (endpoint->wMaxPacketSize < 8)
> > +             return 0;
> > +     if (synusb->iurb) {
> > +             synusb_warn(synusb, "Found more than one possible "
> > +                                 "int in endpoint");
> > +             return 0;
> > +     }
> > +     synusb->iurb = usb_alloc_urb(0, GFP_KERNEL);
> > +     if (synusb->iurb == NULL)
> > +             return -ENOMEM;
> > +     buf = usb_alloc_coherent(synusb->udev, 8, GFP_ATOMIC,
> > +                              &synusb->iurb->transfer_dma);
> > +     if (buf == NULL)
> > +             return -ENOMEM;
> 
> You seem to leak synusb->iurb here.

Seems so, but doesn't. It gets freed when the refcount hits 0.
Now, whether this is a good technique is another question.

	Regards
		Oliver
-- 
- - - 
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 
Maxfeldstraße 5                         
90409 Nürnberg 
Germany 
- - - 

  reply	other threads:[~2012-01-04  9:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03 18:40 [PATCH] input: Synaptics USB device driver Jan Steinhoff
2012-01-03 18:40 ` Jan Steinhoff
2012-01-04  8:25 ` Oliver Neukum
2012-01-04  8:25   ` Oliver Neukum
     [not found]   ` <201201040926.00117.oneukum-l3A5Bk7waGM@public.gmane.org>
2012-01-05  2:46     ` Jan Steinhoff
2012-01-05  2:46       ` Jan Steinhoff
2012-01-04  8:55 ` Jiri Kosina
2012-01-04  8:55   ` Jiri Kosina
2012-01-04  9:20   ` Oliver Neukum [this message]
2012-01-04  9:20     ` Oliver Neukum
2012-01-04  9:41     ` Dmitry Torokhov
2012-01-04  9:41       ` Dmitry Torokhov
     [not found]       ` <20120104094103.GA29069-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-01-04  9:56         ` Oliver Neukum
2012-01-04  9:56           ` Oliver Neukum
2012-01-04 10:05           ` Dmitry Torokhov
2012-01-04 10:05             ` Dmitry Torokhov
2012-01-05  6:01             ` Jan Steinhoff
2012-01-05  6:01               ` Jan Steinhoff
2012-01-05  6:36               ` Dmitry Torokhov
2012-01-05  6:36                 ` Dmitry Torokhov
2012-01-05 14:22                 ` Jan Steinhoff
2012-01-05 14:22                   ` Jan Steinhoff
2012-01-10  9:43                   ` Dmitry Torokhov
2012-01-10  9:43                     ` Dmitry Torokhov
2012-01-12  0:08                     ` Jan Steinhoff
2012-01-12  0:08                       ` Jan Steinhoff
2012-01-18  5:25                       ` Dmitry Torokhov
2012-01-18  5:25                         ` Dmitry Torokhov
2012-01-05  5:39       ` Jan Steinhoff
2012-01-05  5:39         ` Jan Steinhoff
2012-01-05  6:34         ` Dmitry Torokhov
2012-01-05  6:34           ` Dmitry Torokhov

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=201201041020.41795.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mail@jan-steinhoff.de \
    --cc=rubini@ipvvis.unipv.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.