lkml.org 
[lkml]   [2019]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: musb: Fix potential NULL dereference
On Fri, 25 Jan 2019, Bin Liu wrote:

> On Thu, Jan 24, 2019 at 09:47:02PM +0300, Matwey V. Kornilov wrote:
> > By the way, why do we need to store the qh in urb->hcpriv?
> > qh can always be accessible through urb->ep->hcpriv
> > Wouldn't it be better to drop entire urb->hcpriv usage?
>
> I am not sure why. The code is there since the first commit in a decade
> ago. But I tend to agree with you.
>
> In a quick search for urb->hcpriv and urb->ep->hcpriv, based on the
> usage in core/hcd.c, it seems to me that urb->hcpriv should not be
> changed in each controller driver, but I see both have been used in most
> controller drivers. I will leave this to others to educate me.

In some of the older HCDs, urb->hcpriv != NULL is used to indicate that
urb is on an endpoint queue. Perhaps that usage was copied.

Alan Stern

\
 
 \ /
  Last update: 2019-01-25 22:38    [W:0.085 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site