Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /fs/ecryptfs/messaging.c

Filename:/fs/ecryptfs/messaging.c
Lines Added:4
Lines Deleted:2
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6-git12  2.6.24-rc6-git11  2.6.24-rc6-git10  2.6.24-rc6-git9 
(Following) 2.6.25-git14  2.6.25-git15  2.6.25-git16  2.6.25-git17  2.6.25-git18  2.6.25-git19 

Location
[  2.6.24
  [  fs
    [  ecryptfs
       o  messaging.c

Patch

diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index a9d87c4..9cc2aec 100644
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -419,13 +419,15 @@ int ecryptfs_init_messaging(unsigned int transport)
    }
    mutex_init(&ecryptfs_daemon_id_hash_mux);
    mutex_lock(&ecryptfs_daemon_id_hash_mux);
-   ecryptfs_hash_buckets = 0;
-   while (ecryptfs_number_of_users >> ++ecryptfs_hash_buckets);
+   ecryptfs_hash_buckets = 1;
+   while (ecryptfs_number_of_users >> ecryptfs_hash_buckets)
+      ecryptfs_hash_buckets++;
    ecryptfs_daemon_id_hash = kmalloc(sizeof(struct hlist_head)
                  * ecryptfs_hash_buckets, GFP_KERNEL);
    if (!ecryptfs_daemon_id_hash) {
       rc = -ENOMEM;
       ecryptfs_printk(KERN_ERR, "Failed to allocate memory\n");
+      mutex_unlock(&ecryptfs_daemon_id_hash_mux);
       goto out;
    }
    for (i = 0; i < ecryptfs_hash_buckets; i++)


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.