From: Michael Halcrow Date: Thu, 1 Mar 2007 04:12:57 +0000 (-0800) Subject: [PATCH] eCryptfs: no path_release() after path_lookup() error X-Git-Tag: firefly_0821_release~30922 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=65dc8145711d1c20aecbb1a8a4a518f7c68611b8;p=firefly-linux-kernel-4.4.55.git [PATCH] eCryptfs: no path_release() after path_lookup() error Dmitriy Monakhov wrote: > if path_lookup() return non zero code we don't have to worry about > 'nd' parameter, but ecryptfs_read_super does path_release(&nd) after > path_lookup has failed, and dentry counter becomes negative Do not do a path_release after a path_lookup error. Signed-off-by: Michael Halcrow Cc: Dmitriy Monakhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 80044d196fe0..812427e6805c 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -487,7 +487,7 @@ static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) rc = path_lookup(dev_name, LOOKUP_FOLLOW, &nd); if (rc) { ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n"); - goto out_free; + goto out; } lower_root = nd.dentry; if (!lower_root->d_inode) {