]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ecryptfs/miscdev.c
eCryptFS: fix imbalanced mutex locking
[linux-2.6-omap-h63xx.git] / fs / ecryptfs / miscdev.c
index 788995efd1d3247298a3107935a8a54fccd80cfd..6560da1a58ce7a885f4624cd663d4d70a8eb3475 100644 (file)
@@ -257,12 +257,14 @@ ecryptfs_miscdev_read(struct file *file, char __user *buf, size_t count,
        mutex_lock(&daemon->mux);
        if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) {
                rc = 0;
+               mutex_unlock(&ecryptfs_daemon_hash_mux);
                printk(KERN_WARNING "%s: Attempt to read from zombified "
                       "daemon\n", __func__);
                goto out_unlock_daemon;
        }
        if (daemon->flags & ECRYPTFS_DAEMON_IN_READ) {
                rc = 0;
+               mutex_unlock(&ecryptfs_daemon_hash_mux);
                goto out_unlock_daemon;
        }
        /* This daemon will not go away so long as this flag is set */