diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 56d1741fe0413ae27b253f7e0b5cf481b04a2d0c..4b6f73e201a4c826c4704c7fa73825e1218e22d8 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -295,10 +295,9 @@ static struct eventfs_inode *eventfs_find_events(struct dentry *dentry) * If the ei is being freed, the ownership of the children * doesn't matter. */ - if (ei->is_freed) { - ei = NULL; - break; - } + if (ei->is_freed) + return NULL; + // Walk upwards until you find the events inode } while (!ei->is_events);