From 15fe551b51b82106b6353fe65ed6dd31a093e8b6 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Tue, 15 Apr 2008 13:07:44 -0400 Subject: [PATCH] Unionfs: don't dereference dentry without lower branches in d_release Signed-off-by: Erez Zadok --- fs/unionfs/dentry.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c index ee0da4f45e9..e5f894cd937 100644 --- a/fs/unionfs/dentry.c +++ b/fs/unionfs/dentry.c @@ -482,12 +482,14 @@ static void unionfs_d_release(struct dentry *dentry) int bindex, bstart, bend; unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD); + if (unlikely(!UNIONFS_D(dentry))) + goto out; /* skip if no lower branches */ /* must lock our branch configuration here */ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD); unionfs_check_dentry(dentry); /* this could be a negative dentry, so check first */ - if (unlikely(!UNIONFS_D(dentry) || dbstart(dentry) < 0)) { + if (dbstart(dentry) < 0) { unionfs_unlock_dentry(dentry); goto out; /* due to a (normal) failed lookup */ } -- 2.34.1