linux/drivers/usb/gadget/udc
Alan Stern 7ae2c3c280 USB: UDC core: fix double-free in usb_add_gadget_udc_release
The error-handling pathways in usb_add_gadget_udc_release() are messed
up.  Aside from the uninformative statement labels, they can deallocate
the udc structure after calling put_device(), which is a double-free.
This was observed by KASAN in automatic testing.

This patch cleans up the routine.  It preserves the requirement that
when any failure occurs, we call put_device(&gadget->dev).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
CC: <stable@vger.kernel.org>
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09 16:06:53 +01:00
..
bdc usb: bdc: fix platform_no_drv_owner.cocci warnings 2017-11-27 13:33:30 +02:00
Kconfig usb: gadget: udc: fix snps_udc_plat.c build errors 2017-09-20 14:57:28 +03:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
amd5536udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
amd5536udc_pci.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
at91_udc.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
at91_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
atmel_usba_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
atmel_usba_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
bcm63xx_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
core.c USB: UDC core: fix double-free in usb_add_gadget_udc_release 2018-01-09 16:06:53 +01:00
dummy_hcd.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
fotg210-udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fotg210.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fsl_mxc_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fsl_qe_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fsl_qe_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fsl_udc_core.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fsl_usb2_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fusb300_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
fusb300_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
goku_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
goku_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
gr_udc.c USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
gr_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
lpc32xx_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
m66592-udc.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
m66592-udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
mv_u3d.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
mv_u3d_core.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
mv_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
mv_udc_core.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
net2272.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
net2272.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
net2280.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
net2280.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
omap_udc.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
omap_udc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pch_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
pxa25x_udc.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
pxa25x_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
pxa27x_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
pxa27x_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
r8a66597-udc.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
r8a66597-udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
renesas_usb3.c usb: gadget: udc: renesas_usb3: fix number of the pipes 2017-11-28 13:04:54 +02:00
s3c-hsudc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
s3c2410_udc.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
s3c2410_udc.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
snps_udc_core.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
snps_udc_plat.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
trace.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
trace.h USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00
udc-xilinx.c USB: gadget: udc: Remove redundant license text 2017-11-07 15:45:02 +01:00