]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thunderbolt: Fix memory leak in margining_port_remove()
authorYaxiong Tian <tianyaxiong@kylinos.cn>
Wed, 22 Nov 2023 08:02:43 +0000 (16:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:39:08 +0000 (12:39 +0000)
commit3339028dd082a789f9010f49708026950349eca1
treec7e721be3e51035d8cc34d9b637190d29d03fa0c
parent69b6596c6e4aa581eaed734497c7fcfb5c3a75fe
thunderbolt: Fix memory leak in margining_port_remove()

commit ac43c9122e4287bbdbe91e980fc2528acb72cc1e 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: d0f1e0c2a699 ("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>
drivers/thunderbolt/debugfs.c