@@ -639,11 +639,9 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
639639 int rc = 0 ;
640640
641641 s = kzalloc (sizeof (* s ), GFP_KERNEL );
642- if (!s ) {
643- printk (KERN_ERR "%s: Out of memory whilst trying to kmalloc "
644- "[%zd] bytes of kernel memory\n" , __func__ , sizeof (* s ));
642+ if (!s )
645643 return - ENOMEM ;
646- }
644+
647645 (* packet_size ) = 0 ;
648646 rc = ecryptfs_find_auth_tok_for_sig (
649647 & auth_tok_key ,
@@ -714,9 +712,6 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
714712 s -> block_aligned_filename = kzalloc (s -> block_aligned_filename_size ,
715713 GFP_KERNEL );
716714 if (!s -> block_aligned_filename ) {
717- printk (KERN_ERR "%s: Out of kernel memory whilst attempting to "
718- "kzalloc [%zd] bytes\n" , __func__ ,
719- s -> block_aligned_filename_size );
720715 rc = - ENOMEM ;
721716 goto out_unlock ;
722717 }
@@ -769,10 +764,6 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
769764 s -> hash_desc = kmalloc (sizeof (* s -> hash_desc ) +
770765 crypto_shash_descsize (s -> hash_tfm ), GFP_KERNEL );
771766 if (!s -> hash_desc ) {
772- printk (KERN_ERR "%s: Out of kernel memory whilst attempting to "
773- "kmalloc [%zd] bytes\n" , __func__ ,
774- sizeof (* s -> hash_desc ) +
775- crypto_shash_descsize (s -> hash_tfm ));
776767 rc = - ENOMEM ;
777768 goto out_release_free_unlock ;
778769 }
@@ -925,11 +916,9 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
925916 (* filename_size ) = 0 ;
926917 (* filename ) = NULL ;
927918 s = kzalloc (sizeof (* s ), GFP_KERNEL );
928- if (!s ) {
929- printk (KERN_ERR "%s: Out of memory whilst trying to kmalloc "
930- "[%zd] bytes of kernel memory\n" , __func__ , sizeof (* s ));
919+ if (!s )
931920 return - ENOMEM ;
932- }
921+
933922 if (max_packet_size < ECRYPTFS_TAG_70_MIN_METADATA_SIZE ) {
934923 printk (KERN_WARNING "%s: max_packet_size is [%zd]; it must be "
935924 "at least [%d]\n" , __func__ , max_packet_size ,
@@ -1015,9 +1004,6 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
10151004 s -> decrypted_filename = kmalloc (s -> block_aligned_filename_size ,
10161005 GFP_KERNEL );
10171006 if (!s -> decrypted_filename ) {
1018- printk (KERN_ERR "%s: Out of memory whilst attempting to "
1019- "kmalloc [%zd] bytes\n" , __func__ ,
1020- s -> block_aligned_filename_size );
10211007 rc = - ENOMEM ;
10221008 goto out_unlock ;
10231009 }
@@ -1097,9 +1083,6 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
10971083 }
10981084 (* filename ) = kmalloc (((* filename_size ) + 1 ), GFP_KERNEL );
10991085 if (!(* filename )) {
1100- printk (KERN_ERR "%s: Out of memory whilst attempting to "
1101- "kmalloc [%zd] bytes\n" , __func__ ,
1102- ((* filename_size ) + 1 ));
11031086 rc = - ENOMEM ;
11041087 goto out_free_unlock ;
11051088 }
@@ -2525,11 +2508,9 @@ int ecryptfs_add_keysig(struct ecryptfs_crypt_stat *crypt_stat, char *sig)
25252508 struct ecryptfs_key_sig * new_key_sig ;
25262509
25272510 new_key_sig = kmem_cache_alloc (ecryptfs_key_sig_cache , GFP_KERNEL );
2528- if (!new_key_sig ) {
2529- printk (KERN_ERR
2530- "Error allocating from ecryptfs_key_sig_cache\n" );
2511+ if (!new_key_sig )
25312512 return - ENOMEM ;
2532- }
2513+
25332514 memcpy (new_key_sig -> keysig , sig , ECRYPTFS_SIG_SIZE_HEX );
25342515 new_key_sig -> keysig [ECRYPTFS_SIG_SIZE_HEX ] = '\0' ;
25352516 /* Caller must hold keysig_list_mutex */
@@ -2551,8 +2532,6 @@ ecryptfs_add_global_auth_tok(struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
25512532 GFP_KERNEL );
25522533 if (!new_auth_tok ) {
25532534 rc = - ENOMEM ;
2554- printk (KERN_ERR "Error allocating from "
2555- "ecryptfs_global_auth_tok_cache\n" );
25562535 goto out ;
25572536 }
25582537 memcpy (new_auth_tok -> sig , sig , ECRYPTFS_SIG_SIZE_HEX );
0 commit comments