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

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

 



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...
>  	 */
> +	spin_lock_irqsave(&musb->lock, flags);
>  	qh = kzalloc(sizeof *qh, mem_flags);
>  	if (!qh) {
>  		usb_hcd_unlink_urb_from_ep(hcd, urb);
> +		spin_unlock_irqrestore(&musb->lock, flags);
>  		return -ENOMEM;
>  	}

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.

Alan Stern

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

[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