]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00160834 UTP : replace kzalloc() with vmalloc()
authorHuang Shijie <b32955@freescale.com>
Wed, 26 Oct 2011 09:31:25 +0000 (17:31 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 2 Nov 2015 13:13:53 +0000 (14:13 +0100)
commitbb5f7f792d5d34f061234eca2ec53d0f154eda89
tree71e6e40a8a95a6f1e9ed83a1e16a90aa733e3941
parenta96e38ab56a524fb883f4a8302752dd17415d130
ENGR00160834 UTP : replace kzalloc() with vmalloc()

When allocating large memory, such as 128K,
vmalloc() uses single page for the allocation process,
while kzalloc() has to consume a continuous pages for the allocation.

In low memory case, the kzalloc() may fails.
So use the vmalloc() instead.

Also add some sanity check for the NULL pointer.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/usb/gadget/function/fsl_updater.c