Re: [PATCH] USB: EHCI: Fix isochronous URB leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Mittwoch, 25. Februar 2009 schrieb David Brownell:
> On Monday 23 February 2009, Karsten Wiese wrote:
> > ehci-hcd uses usb_get_urb() and usb_put_urb() in an unbalanced way
> 
> How exactly are they unbalanced?

The local *urb is NULL when usb_put_urb() is called after URB has
been given back.


 
> > causing 
> > isochronous URB's kref.counts incrementing once per usb_submit_urb() call.
> 
> So long as they're decremented once on the giveback, no problem:
> one increment, one decrement, all is fine.  Actually the policy
> was that each saved pointer gets a refcount, so each *ITD* (or
> for fullspeed, SITD) gets a refcount.
> 
> 
> > There is no need for ehci-hcd to deal with usb_get_urb() nor usb_put_urb()
> > anyhow,
> 
> That might now be true; usbcore has changed quite a lot since
> that code was written.
> 
> 
> > so patch removes their usages in ehci-hcd. 
> > It also removes NULL assignments that have no effect.
> 
> Leave those NULL assignments please.  They are not "no effect";
> they ensure that "old" pointers don't linger.  Such things can
> be useful invariants when tracking down bugs ... among other
> things, it causes immediate trouble the instance anyone tries
> to use a stale pointer.

For me those NULL assignments make understanding the code harder.
They make me wonder "why are they there?" as in xitd_urb_transaction
an xITD is kmemset to zero before use.


Thanks,
Karsten

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux