lkml.org 
[lkml]   [2012]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] input: Synaptics USB device driver
    Date
    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-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-01-04 10:21    [W:0.033 / U:86.564 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site