mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 04:16:39 +00:00
thunderbolt: Fix memory leak in margining_port_remove()
commitac43c9122e
upstream. The dentry returned by debugfs_lookup() needs to be released by calling dput() which is missing in margining_port_remove(). Fix this by calling debugfs_lookup_and_remove() that combines both and avoids the memory leak. Fixes:d0f1e0c2a6
("thunderbolt: Add support for receiver lane margining") Cc: stable@vger.kernel.org Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
69b6596c6e
commit
3339028dd0
1 changed files with 1 additions and 1 deletions
|
@ -943,7 +943,7 @@ static void margining_port_remove(struct tb_port *port)
|
|||
snprintf(dir_name, sizeof(dir_name), "port%d", port->port);
|
||||
parent = debugfs_lookup(dir_name, port->sw->debugfs_dir);
|
||||
if (parent)
|
||||
debugfs_remove_recursive(debugfs_lookup("margining", parent));
|
||||
debugfs_lookup_and_remove("margining", parent);
|
||||
|
||||
kfree(port->usb4->margining);
|
||||
port->usb4->margining = NULL;
|
||||
|
|
Loading…
Reference in a new issue