thunderbolt: debugfs: Fix dentry reference leaks in margining_port_init
Subsystems (3)
PATCH 1/1 thunderbolt: debugfs: Fix dentry reference leaks in margining_port_init
The debugfs_lookup() function returns a dentry with an increased reference count that must be released by calling dput().
Fixes d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/thunderbolt/debugfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/thunderbolt/debugfs.c +1 -0
@@ -1770,6 +1770,7 @@ static void margining_port_init(struct tb_port *port) port->usb4->margining =margining_alloc (port, &port->usb4->dev,USB4_SB_TARGET_ROUTER ,0 , parent); +dput (parent); }static void margining_port_remove (struct tb_port *port)
Signature · 1 line
2.35.1
Quoted 2 lines · Miaoqian Lin
The
debugfs_lookup()function returns a dentry with an increased reference count that must be released by callingdput().
Don't we need the same for margining_port_remove() too?
Quoted 22 lines
Fixes d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining")Signed-off-by Miaoqian Lin <[email protected]>--- drivers/thunderbolt/debugfs.c | 1 + 1 file changed, 1 insertion(+)drivers/thunderbolt/debugfs.c +1
-0@@ -1770,6 +1770,7 @@ static void margining_port_init(struct tb_port *port) port->usb4->margining =margining_alloc (port, &port->usb4->dev,USB4_SB_TARGET_ROUTER ,0 , parent); +dput (parent); }static void margining_port_remove (struct tb_port *port)Signature · 1 line
2.35.1