[PATCH] staging: btmtk_usb: check for a valid io_buf pointer

Dan Carpenter dan.carpenter at oracle.com
Sat May 25 18:44:18 UTC 2013


On Sat, May 25, 2013 at 11:04:16PM -0400, Devendra Naga wrote:
> assigned to retval of kmalloc but not checked whether the allocation failed or not,
> fail the registering if allocation fail
> 
> Signed-off-by: Devendra Naga <devendra.aaru at gmail.com>
> ---
> 
> Hello, 
> 
> Seems that kmalloc is called with GFP_ATOMIC flag
> which is in registering stage, as since there wont be any
> interrupt context in this path, may i change it to GFP_KERNEL in a
> subsequent patch?

Yes.  Feel free to change it.

It's not in an IRQ and there are no spinlocks held.  We just did a
GFP_KERNEL allocation a few lines earlier in the call to
hci_alloc_dev().

regards,
dan carpenter




More information about the devel mailing list