diff options
Diffstat (limited to 'fs/ecryptfs/messaging.c')
-rw-r--r-- | fs/ecryptfs/messaging.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 286f10b0363b..9fdd5bcf4564 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c | |||
@@ -147,8 +147,6 @@ ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file) | |||
147 | (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL); | 147 | (*daemon) = kzalloc(sizeof(**daemon), GFP_KERNEL); |
148 | if (!(*daemon)) { | 148 | if (!(*daemon)) { |
149 | rc = -ENOMEM; | 149 | rc = -ENOMEM; |
150 | printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of " | ||
151 | "GFP_KERNEL memory\n", __func__, sizeof(**daemon)); | ||
152 | goto out; | 150 | goto out; |
153 | } | 151 | } |
154 | (*daemon)->file = file; | 152 | (*daemon)->file = file; |
@@ -250,8 +248,6 @@ int ecryptfs_process_response(struct ecryptfs_daemon *daemon, | |||
250 | msg_ctx->msg = kmemdup(msg, msg_size, GFP_KERNEL); | 248 | msg_ctx->msg = kmemdup(msg, msg_size, GFP_KERNEL); |
251 | if (!msg_ctx->msg) { | 249 | if (!msg_ctx->msg) { |
252 | rc = -ENOMEM; | 250 | rc = -ENOMEM; |
253 | printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of " | ||
254 | "GFP_KERNEL memory\n", __func__, msg_size); | ||
255 | goto unlock; | 251 | goto unlock; |
256 | } | 252 | } |
257 | msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE; | 253 | msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE; |
@@ -386,7 +382,6 @@ int __init ecryptfs_init_messaging(void) | |||
386 | GFP_KERNEL); | 382 | GFP_KERNEL); |
387 | if (!ecryptfs_daemon_hash) { | 383 | if (!ecryptfs_daemon_hash) { |
388 | rc = -ENOMEM; | 384 | rc = -ENOMEM; |
389 | printk(KERN_ERR "%s: Failed to allocate memory\n", __func__); | ||
390 | mutex_unlock(&ecryptfs_daemon_hash_mux); | 385 | mutex_unlock(&ecryptfs_daemon_hash_mux); |
391 | goto out; | 386 | goto out; |
392 | } | 387 | } |
@@ -398,7 +393,6 @@ int __init ecryptfs_init_messaging(void) | |||
398 | GFP_KERNEL); | 393 | GFP_KERNEL); |
399 | if (!ecryptfs_msg_ctx_arr) { | 394 | if (!ecryptfs_msg_ctx_arr) { |
400 | rc = -ENOMEM; | 395 | rc = -ENOMEM; |
401 | printk(KERN_ERR "%s: Failed to allocate memory\n", __func__); | ||
402 | goto out; | 396 | goto out; |
403 | } | 397 | } |
404 | mutex_init(&ecryptfs_msg_ctx_lists_mux); | 398 | mutex_init(&ecryptfs_msg_ctx_lists_mux); |
@@ -442,15 +436,16 @@ void ecryptfs_release_messaging(void) | |||
442 | } | 436 | } |
443 | if (ecryptfs_daemon_hash) { | 437 | if (ecryptfs_daemon_hash) { |
444 | struct ecryptfs_daemon *daemon; | 438 | struct ecryptfs_daemon *daemon; |
439 | struct hlist_node *n; | ||
445 | int i; | 440 | int i; |
446 | 441 | ||
447 | mutex_lock(&ecryptfs_daemon_hash_mux); | 442 | mutex_lock(&ecryptfs_daemon_hash_mux); |
448 | for (i = 0; i < (1 << ecryptfs_hash_bits); i++) { | 443 | for (i = 0; i < (1 << ecryptfs_hash_bits); i++) { |
449 | int rc; | 444 | int rc; |
450 | 445 | ||
451 | hlist_for_each_entry(daemon, | 446 | hlist_for_each_entry_safe(daemon, n, |
452 | &ecryptfs_daemon_hash[i], | 447 | &ecryptfs_daemon_hash[i], |
453 | euid_chain) { | 448 | euid_chain) { |
454 | rc = ecryptfs_exorcise_daemon(daemon); | 449 | rc = ecryptfs_exorcise_daemon(daemon); |
455 | if (rc) | 450 | if (rc) |
456 | printk(KERN_ERR "%s: Error whilst " | 451 | printk(KERN_ERR "%s: Error whilst " |