linux-stable/kernel/printk
Greg Kroah-Hartman 13969236b6 kernel/printk/index.c: fix memory leak with using debugfs_lookup()
[ Upstream commit 55bf243c51 ]

When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time.  To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.

Cc: Chris Down <chris@chrisdown.name>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230202151411.2308576-1-gregkh@linuxfoundation.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 13:50:37 +01:00
..
Makefile printk: move printk sysctl to printk/sysctl.c 2022-01-22 08:33:35 +02:00
braille.c printk: Replace strncmp() with str_has_prefix() 2019-08-16 09:54:08 +02:00
braille.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
console_cmdline.h printk: Fix preferred console selection with multiple matches 2020-02-18 09:34:42 +01:00
index.c kernel/printk/index.c: fix memory leak with using debugfs_lookup() 2023-03-11 13:50:37 +01:00
internal.h Revert "printk: Wait for the global console lock when the system is going down" 2022-06-23 18:41:40 +02:00
printk.c Merge branch 'rework/console-list-lock' into for-linus 2023-01-19 14:56:38 +01:00
printk_ringbuffer.c printk: fix a typo of comment 2022-11-22 12:10:15 +01:00
printk_ringbuffer.h printk: ringbuffer: Improve prb_next_seq() performance 2022-01-26 16:00:32 +01:00
printk_safe.c Revert "printk: Wait for the global console lock when the system is going down" 2022-06-23 18:41:40 +02:00
sysctl.c printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() 2022-02-03 11:27:38 -08:00