aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/trace-event-scripting.c
diff options
context:
space:
mode:
authorMathias Nyman <[email protected]>2020-02-11 17:01:58 +0200
committerGreg Kroah-Hartman <[email protected]>2020-02-12 09:51:09 -0800
commitcf0ee7c60c89641f6e4d1d3c7867fe32b9e30300 (patch)
tree76a1dffa40a62b9da153f0d93f9cf1dd8304abc4 /tools/perf/util/trace-event-scripting.c
parent67f68f977a12657028e866c013d43dd87320d210 (diff)
xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2
xhci driver assumed that xHC controllers have at most one custom supported speed table (PSI) for all usb 3.x ports. Memory was allocated for one PSI table under the xhci hub structure. Turns out this is not the case, some controllers have a separate "supported protocol capability" entry with a PSI table for each port. This means each usb3 roothub port can in theory support different custom speeds. To solve this, cache all supported protocol capabilities with their PSI tables in an array, and add pointers to the xhci port structure so that every port points to its capability entry in the array. When creating the SuperSpeedPlus USB Device Capability BOS descriptor for the xhci USB 3.1 roothub we for now will use only data from the first USB 3.1 capable protocol capability entry in the array. This could be improved later, this patch focuses resolving the memory leak. Reported-by: Paul Menzel <[email protected]> Reported-by: Sajja Venkateswara Rao <[email protected]> Fixes: 47189098f8be ("xhci: parse xhci protocol speed ID list for usb 3.1 usage") Cc: stable <[email protected]> # v4.4+ Signed-off-by: Mathias Nyman <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions