linux-uconsole/drivers/usb/gadget
Nicholas Mc Guire 6d78742c57 usb: gadget: fsl_udc_core: check allocation return value and cleanup on failure
[ Upstream commit 4ab2b48c98 ]

The allocation with fsl_alloc_request() and kmalloc() were unchecked
fixed this up with a NULL check and appropriate cleanup.

Additionally udc->ep_qh_size was reset to 0 on failure of allocation.
Similar udc->phy_mode is initially 0 (as udc_controller was
allocated with kzalloc in fsl_udc_probe()) so reset it to 0 as well
so that this function is side-effect free on failure. Not clear if
this is necessary or sensible as fsl_udc_release() probably can not
be called if fsl_udc_probe() failed - but it should not hurt.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: b504882da5 ("USB: add Freescale high-speed USB SOC device controller driver")
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:49:57 +01:00
..
function usb: gadget: fix wrong endpoint desc 2020-01-09 10:18:57 +01:00
legacy usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer" 2018-07-26 13:35:29 +03:00
udc usb: gadget: fsl_udc_core: check allocation return value and cleanup on failure 2020-01-27 14:49:57 +01:00
composite.c usb: gadget: composite: Fix possible double free memory bug 2019-11-12 19:21:04 +01:00
config.c
configfs.c usb: gadget: configfs: Fix missing spin_lock_init() 2019-12-17 20:34:28 +01:00
configfs.h
epautoconf.c
functions.c
Kconfig
Makefile
u_f.c
u_f.h
u_os_desc.h
usbstring.c