lkml.org 
[lkml]   [2024]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] eventfs: Directly return NULL to avoid null point dereferenced
Date
From: Hao Ge <gehao@kylinos.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@kylinos.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

\
 
 \ /
  Last update: 2024-05-27 18:24    [W:0.171 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site