Re: [PATCH v2] OMAP:MUSB: Corrects urb unlink function path

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

 



On Fri, Aug 22, 2008 at 01:32:12PM -0400, Alan Stern wrote:
> On Fri, 22 Aug 2008 ajay.gupta@xxxxxx wrote:
> 
> > @@ -1785,9 +1784,11 @@ static int musb_urb_enqueue(
> >  	 * REVISIT consider a dedicated qh kmem_cache, so it's harder
> >  	 * for bugs in other kernel code to break this driver...
> >  	 */
> 
> This doesn't look right.  After calling spin_lock_irqsave you are in an 
> atomic context, so you can't pass mem_flags to kzalloc.
> 
> Either move the spin_lock_irqsave after the call to kzalloc or else 
> change mem_flags to GFP_ATOMIC.

first one, please.

should be like:

 	qh = kzalloc(sizeof *qh, mem_flags);
 	if (!qh) {
+		spin_lock_irqsave(&musb->lock, flags);
 		usb_hcd_unlink_urb_from_ep(hcd, urb);
+		spin_unlock_irqrestore(&musb->lock, flags);
 		return -ENOMEM;
 	}

-- 
balbi

Attachment: pgpIe4J7H15rH.pgp
Description: PGP signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux