Re: [PATCH] drivers/usb/host/ohci* : set urb->hcpriv = NULL immediately, after free it

2012-12-18 Thread Chen Gang
于 2012年12月18日 23:17, Alan Stern 写道: >> static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) >> > { >> > - int last = urb_priv->length - 1; >> > + int last; >> > >> > + if (!urb_priv) >> > + return; >> > + >> > + last = urb_priv->length - 1;

Re: [PATCH] drivers/usb/host/ohci* : set urb->hcpriv = NULL immediately, after free it

2012-12-18 Thread Alan Stern
On Tue, 18 Dec 2012, Chen Gang wrote: > although we can not say it is surely a bug. > it is better to set urb->hcpriv = NULL, after finish calling urb_free_priv. > before kfree urb_priv, better to judge whether urb_priv == NULL, firstly. > > Signed-off-by: Chen Gang > --- > drivers/usb/ho

[PATCH] drivers/usb/host/ohci* : set urb->hcpriv = NULL immediately, after free it

2012-12-18 Thread Chen Gang
although we can not say it is surely a bug. it is better to set urb->hcpriv = NULL, after finish calling urb_free_priv. before kfree urb_priv, better to judge whether urb_priv == NULL, firstly. Signed-off-by: Chen Gang --- drivers/usb/host/ohci-q.c |7 ++- 1 file changed, 6 insert