eCryptFS: fix imbalanced mutex locking

Fix imbalanced calls for mutex lock/unlock on ecryptfs_daemon_hash_mux
Revealed by Ingo Molnar: http://lkml.org/lkml/2008/5/7/260

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Cyrill Gorcunov and committed by Linus Torvalds 43f14d85 d850a2fa

+2
+2
fs/ecryptfs/miscdev.c
··· 257 mutex_lock(&daemon->mux); 258 if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) { 259 rc = 0; 260 printk(KERN_WARNING "%s: Attempt to read from zombified " 261 "daemon\n", __func__); 262 goto out_unlock_daemon; 263 } 264 if (daemon->flags & ECRYPTFS_DAEMON_IN_READ) { 265 rc = 0; 266 goto out_unlock_daemon; 267 } 268 /* This daemon will not go away so long as this flag is set */
··· 257 mutex_lock(&daemon->mux); 258 if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) { 259 rc = 0; 260 + mutex_unlock(&ecryptfs_daemon_hash_mux); 261 printk(KERN_WARNING "%s: Attempt to read from zombified " 262 "daemon\n", __func__); 263 goto out_unlock_daemon; 264 } 265 if (daemon->flags & ECRYPTFS_DAEMON_IN_READ) { 266 rc = 0; 267 + mutex_unlock(&ecryptfs_daemon_hash_mux); 268 goto out_unlock_daemon; 269 } 270 /* This daemon will not go away so long as this flag is set */