linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixed the build warning in init_trace_printk_function_export():
@ 2025-09-07 14:07 Fidal Palamparambil
  2025-09-07 17:01 ` kernel test robot
  2025-09-07 18:33 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Fidal Palamparambil @ 2025-09-07 14:07 UTC (permalink / raw)
  To: linux-modules
  Cc: mcgrof, petr.pavlu, da.gomez, samitolvanen, linux-kernel,
	Fidal palamparambil

From: Fidal palamparambil <rootuserhere@gmail.com>

Changed int ret to struct dentry *dentry

Changed if (ret) to if (IS_ERR_OR_NULL(dentry))

Fixed memory leak in hold_module_trace_bprintk_format():

Added proper cleanup when fmt allocation fails

Set tb_fmt = NULL after freeing to prevent dangling pointers

Fixed NULL pointer dereference in t_show():

Added if (!fmt || !*fmt) check before dereferencing

Simplified the string iteration loop

Added NULL check in trace_is_tracepoint_string():

Added if (!str) check to prevent NULL pointer dereference

Fixed type safety in t_show():

Changed *(unsigned long *)fmt to (unsigned long)fmt for correct pointer casting

Fixed function signature in ftrace_formats_open():

Changed struct file *file to const struct file *file for consistency

Signed-off-by: Fidal palamparambil <rootuserhere@gmail.com>
---
 kernel/trace/trace_printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
index 665effbf50ae..060bd2c35a7d 100644
--- a/kernel/trace/trace_printk.c
+++ b/kernel/trace/trace_printk.c
@@ -363,7 +363,7 @@ static const struct seq_operations show_format_seq_ops = {
 };
 
 static int
-ftrace_formats_open(struct inode *inode, struct file *file)
+ftrace_formats_open(struct inode *inode, const struct file *file)
 {
 	int ret;
 
-- 
2.50.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-07 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-07 14:07 [PATCH] Fixed the build warning in init_trace_printk_function_export(): Fidal Palamparambil
2025-09-07 17:01 ` kernel test robot
2025-09-07 18:33 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).