From: Fidal palamparambil <rootuserh...@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 <rootuserh...@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


Reply via email to