]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ecryptfs/file.c
[PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc().
[net-next-2.6.git] / fs / ecryptfs / file.c
index c5a2e5298f155c0744f653ba8bbc6018f03179ed..779c3477d93c20f7020e3f93f94a4f57838569d7 100644 (file)
@@ -251,7 +251,7 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
        int lower_flags;
 
        /* Released in ecryptfs_release or end of function if failure */
-       file_info = kmem_cache_alloc(ecryptfs_file_info_cache, GFP_KERNEL);
+       file_info = kmem_cache_zalloc(ecryptfs_file_info_cache, GFP_KERNEL);
        ecryptfs_set_file_private(file, file_info);
        if (!file_info) {
                ecryptfs_printk(KERN_ERR,
@@ -259,7 +259,6 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
                rc = -ENOMEM;
                goto out;
        }
-       memset(file_info, 0, sizeof(*file_info));
        lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
        crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat;
        mount_crypt_stat = &ecryptfs_superblock_to_private(