linux-stable/drivers/thunderbolt
Colin Ian King 704a940d55 thunderbolt: fix memory leak of object sw
In the case where the call tb_switch_exceeds_max_depth is true
the error reurn path leaks memory in sw.  Fix this by setting
the return error code to -EADDRNOTAVAIL and returning via the
error exit path err_free_sw_ports to free sw. sw has been kzalloc'd
so the free of the NULL sw->ports is fine.

Addresses-Coverity: ("Resource leak")
Fixes: b04079837b ("thunderbolt: Add initial support for USB4")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20191220220526.11307-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 15:37:41 +01:00
..
Kconfig thunderbolt: Update Kconfig entries to USB4 2019-12-18 15:39:18 +01:00
Makefile thunderbolt: Add support for Time Management Unit 2019-12-18 15:41:15 +01:00
cap.c thunderbolt: Make tb_switch_find_cap() available to other files 2019-12-18 15:40:36 +01:00
ctl.c thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
ctl.h thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
dma_port.c thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
dma_port.h thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
domain.c crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
eeprom.c thunderbolt: Add initial support for USB4 2019-12-18 15:38:55 +01:00
icm.c thunderbolt: Do not start firmware unless asked by the user 2019-11-02 12:13:31 +03:00
lc.c thunderbolt: Add Display Port adapter pairing and resource management 2019-11-02 12:13:31 +03:00
nhi.c thunderbolt: Add initial support for USB4 2019-12-18 15:38:55 +01:00
nhi.h thunderbolt: Add initial support for USB4 2019-12-18 15:38:55 +01:00
nhi_ops.c thunderbolt: Drop unnecessary read when writing LC command in Ice Lake 2019-10-08 12:08:21 +03:00
nhi_regs.h thunderbolt: Add support for Intel Ice Lake 2019-08-26 12:15:06 +03:00
path.c thunderbolt: Add bandwidth management for Display Port tunnels 2019-11-02 12:13:31 +03:00
property.c thunderbolt: property: Fix a missing check of kzalloc 2019-03-28 11:30:47 +03:00
switch.c thunderbolt: fix memory leak of object sw 2020-01-14 15:37:41 +01:00
tb.c thunderbolt: Add support for USB 3.x tunnels 2019-12-18 15:41:40 +01:00
tb.h thunderbolt: Add support for USB 3.x tunnels 2019-12-18 15:41:40 +01:00
tb_msgs.h thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
tb_regs.h thunderbolt: Add support for USB 3.x tunnels 2019-12-18 15:41:40 +01:00
tmu.c thunderbolt: Add support for Time Management Unit 2019-12-18 15:41:15 +01:00
tunnel.c thunderbolt: Add support for USB 3.x tunnels 2019-12-18 15:41:40 +01:00
tunnel.h thunderbolt: Add support for USB 3.x tunnels 2019-12-18 15:41:40 +01:00
usb4.c thunderbolt: Fix xhci check in usb4_switch_setup() 2020-01-08 16:55:42 +01:00
xdomain.c thunderbolt: Add initial support for USB4 2019-12-18 15:38:55 +01:00