From: Erez Zadok Date: Tue, 15 Apr 2008 17:07:44 +0000 (-0400) Subject: Unionfs: don't dereference dentry without lower branches in d_release X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=f2c090b6a2ed7f8c0eed530654d09e08b348743f;p=unionfs-2.6.39.y.git Unionfs: don't dereference dentry without lower branches in d_release Signed-off-by: Erez Zadok --- 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 */ }