usb: chipidea: udc: improve error handling on _hardware_enqueue
authorFelipe F. Tonello <eu@felipetonello.com>
Tue, 27 Oct 2015 10:36:32 +0000 (10:36 +0000)
committerPeter Chen <peter.chen@freescale.com>
Thu, 24 Dec 2015 06:15:26 +0000 (14:15 +0800)
commit779debdf26d4b49598e61e0c28ac97146a2b96fe
treef7f8690838478842e3d19203c136ff498cd58883
parente46fed9fb3a12b1070e2cc5ad03a21b84f94408d
usb: chipidea: udc: improve error handling on _hardware_enqueue

_hardware_enqueue() didn't check for errors when using
add_td_to_list() which can fail if dma_pool_alloc fails, thus
causing a kernel panic when lastnode->ptr is NULL.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/udc.c