[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240511024255.34767-1-hao.ge@linux.dev>
Date: Sat, 11 May 2024 10:42:55 +0800
From: hao.ge@...ux.dev
To: rostedt@...dmis.org,
mhiramat@...nel.org,
mathieu.desnoyers@...icios.com
Cc: linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org,
Hao Ge <gehao@...inos.cn>
Subject: [PATCH] eventfs: Directly return NULL to avoid null point dereferenced
From: Hao Ge <gehao@...inos.cn>
When the condition ei->is_free holds,we return NULL directly to
avoid update_events_attr to use NULL point about ei.
Fixes: 8186fff7ab64 ("tracefs/eventfs: Use root and instance inodes as default ownership")
Signed-off-by: Hao Ge <gehao@...inos.cn>
---
fs/tracefs/event_inode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c
index a878cea70f4c..da2827c6acc2 100644
--- a/fs/tracefs/event_inode.c
+++ b/fs/tracefs/event_inode.c
@@ -346,8 +346,7 @@ static struct eventfs_inode *eventfs_find_events(struct dentry *dentry)
* doesn't matter.
*/
if (ei->is_freed) {
- ei = NULL;
- break;
+ return NULL;
}
// Walk upwards until you find the events inode
} while (!ei->is_events);
--
2.25.1
Powered by blists - more mailing lists