linux/drivers/usb
Pawel Laszczak e2d60f8c47
usb: cdnsp: fix error handling in cdnsp_mem_init()
This function uses "One Function Cleans up Everything" style and that's
basically impossible to do correctly. It's cleaner to write it with
"clean up the most recent allocation".

Patch fixes two isues:
1. If pdev->dcbaa = dma_alloc_coherent() fails then that leads to a NULL
   dereference inside the cdnsp_free_priv_device() function.
2. if cdnsp_alloc_priv_device() fails that leads to a double free because
   we free pdev->out_ctx.bytes in several places.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-12-29 12:36:13 +08:00
..
atm drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk() 2020-12-09 15:22:51 +01:00
c67x00 Linux 5.9-rc3 2020-08-31 07:11:45 +02:00
cdns3 usb: cdnsp: fix error handling in cdnsp_mem_init() 2020-12-29 12:36:13 +08:00
chipidea Below are main changes for v5.11-rc1: 2020-12-10 11:30:31 +01:00
class usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode 2020-11-13 15:26:49 +01:00
common usb: common: ulpi: Constify static attribute_group struct 2020-11-26 13:40:43 +01:00
core USB: add RESET_RESUME quirk for Snapscan 1212 2020-12-07 15:29:08 +01:00
dwc2 usb: dwc2: Avoid leaving the error_debugfs label unused 2020-10-27 11:33:53 +02:00
dwc3 USB: fixes for v5.10-rc2 2020-11-02 13:36:11 +01:00
early usb: early: ehci-dbgp: convert to readl_poll_timeout_atomic() 2020-09-25 16:29:09 +02:00
gadget for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
host powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
image USB: microtek: use set_host_byte() 2020-09-16 12:42:10 +02:00
isp1760 usb: isp1760-hcd: convert to readl_poll_timeout_atomic() 2020-09-25 16:30:05 +02:00
misc USB / Thunderbolt patches for 5.11-rc1 2020-12-15 13:54:56 -08:00
mon
mtu3 usb: mtu3: fix memory corruption in mtu3_debugfs_regset() 2020-12-07 15:26:18 +01:00
musb usb: Fix fall-through warnings for Clang 2020-11-23 17:46:01 +01:00
phy Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
renesas_usbhs usb: Use fallthrough pseudo-keyword 2020-07-10 08:55:17 +02:00
roles device connection: Remove struct device_connection 2020-09-07 11:14:09 +02:00
serial USB-serial updates for 5.11-rc1 2020-12-11 16:16:52 +01:00
storage USB: UAS: introduce a quirk to set no_write_same 2020-12-09 20:00:26 +01:00
typec usb: ucsi: convert comma to semicolon 2020-12-11 16:19:54 +01:00
usbip usbip: Remove in_interrupt() check 2020-10-28 13:06:06 +01:00
Kconfig
Makefile usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
usb-skeleton.c