afs: mntput called before dput
authorAndreas Gruenbacher <agruen@suse.de>
Tue, 11 Sep 2007 22:23:37 +0000 (15:23 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 12 Sep 2007 00:21:19 +0000 (17:21 -0700)
dput must be called before mntput here.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-By: David Howells <dhowells@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/mntpt.c

index a3684dc..6f8c96f 100644 (file)
@@ -235,8 +235,8 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
        err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts);
        switch (err) {
        case 0:
-               mntput(nd->mnt);
                dput(nd->dentry);
+               mntput(nd->mnt);
                nd->mnt = newmnt;
                nd->dentry = dget(newmnt->mnt_root);
                schedule_delayed_work(&afs_mntpt_expiry_timer,