lkml.org 
[lkml]   [2020]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFT PATCH] xhci: Fix memory leak when caching protocol extended capability PSI tables
On Wed, Jan 08, 2020 at 05:17:30PM +0200, Mathias Nyman wrote:
> 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 port can in theory support different custom speeds.

Is there a "max" number of port capabilities that can happen? Or this
this truely dynamic?

> + for (i = 0; i < xhci->num_port_caps; i++) {
> + kfree(xhci->port_caps[i].psi);
> + xhci->port_caps[i].psi = NULL;
> + }

Nit, no need to set to NULL here :)

thanks,

greg k-h

\
 
 \ /
  Last update: 2020-01-08 16:40    [W:0.093 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site