diff options
Diffstat (limited to 'fs/ecryptfs/main.c')
| -rw-r--r-- | fs/ecryptfs/main.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index d0541ae8faba..fe41ab1566ee 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
| @@ -378,15 +378,13 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
| 378 | 378 | ||
| 379 | /* Released in ecryptfs_put_super() */ | 379 | /* Released in ecryptfs_put_super() */ |
| 380 | ecryptfs_set_superblock_private(sb, | 380 | ecryptfs_set_superblock_private(sb, |
| 381 | kmem_cache_alloc(ecryptfs_sb_info_cache, | 381 | kmem_cache_zalloc(ecryptfs_sb_info_cache, |
| 382 | GFP_KERNEL)); | 382 | GFP_KERNEL)); |
| 383 | if (!ecryptfs_superblock_to_private(sb)) { | 383 | if (!ecryptfs_superblock_to_private(sb)) { |
| 384 | ecryptfs_printk(KERN_WARNING, "Out of memory\n"); | 384 | ecryptfs_printk(KERN_WARNING, "Out of memory\n"); |
| 385 | rc = -ENOMEM; | 385 | rc = -ENOMEM; |
| 386 | goto out; | 386 | goto out; |
| 387 | } | 387 | } |
| 388 | memset(ecryptfs_superblock_to_private(sb), 0, | ||
| 389 | sizeof(struct ecryptfs_sb_info)); | ||
| 390 | sb->s_op = &ecryptfs_sops; | 388 | sb->s_op = &ecryptfs_sops; |
| 391 | /* Released through deactivate_super(sb) from get_sb_nodev */ | 389 | /* Released through deactivate_super(sb) from get_sb_nodev */ |
| 392 | sb->s_root = d_alloc(NULL, &(const struct qstr) { | 390 | sb->s_root = d_alloc(NULL, &(const struct qstr) { |
| @@ -402,7 +400,7 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
| 402 | /* Released in d_release when dput(sb->s_root) is called */ | 400 | /* Released in d_release when dput(sb->s_root) is called */ |
| 403 | /* through deactivate_super(sb) from get_sb_nodev() */ | 401 | /* through deactivate_super(sb) from get_sb_nodev() */ |
| 404 | ecryptfs_set_dentry_private(sb->s_root, | 402 | ecryptfs_set_dentry_private(sb->s_root, |
| 405 | kmem_cache_alloc(ecryptfs_dentry_info_cache, | 403 | kmem_cache_zalloc(ecryptfs_dentry_info_cache, |
| 406 | GFP_KERNEL)); | 404 | GFP_KERNEL)); |
| 407 | if (!ecryptfs_dentry_to_private(sb->s_root)) { | 405 | if (!ecryptfs_dentry_to_private(sb->s_root)) { |
| 408 | ecryptfs_printk(KERN_ERR, | 406 | ecryptfs_printk(KERN_ERR, |
| @@ -410,8 +408,6 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
| 410 | rc = -ENOMEM; | 408 | rc = -ENOMEM; |
| 411 | goto out; | 409 | goto out; |
| 412 | } | 410 | } |
| 413 | memset(ecryptfs_dentry_to_private(sb->s_root), 0, | ||
| 414 | sizeof(struct ecryptfs_dentry_info)); | ||
| 415 | rc = 0; | 411 | rc = 0; |
| 416 | out: | 412 | out: |
| 417 | /* Should be able to rely on deactivate_super called from | 413 | /* Should be able to rely on deactivate_super called from |
