[PATCH]: Cleanup, use kzalloc Use kzalloc instead of kmalloc+memset. Signed-off-by: Peter Korsgaard --- fs/squashfs/inode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) Index: linux/fs/squashfs/inode.c =================================================================== --- linux.orig/fs/squashfs/inode.c +++ linux/fs/squashfs/inode.c @@ -1113,12 +1113,11 @@ TRACE("Entered squashfs_read_superblock\n"); - if (!(s->s_fs_info = kmalloc(sizeof(struct squashfs_sb_info), + if (!(s->s_fs_info = kzalloc(sizeof(struct squashfs_sb_info), GFP_KERNEL))) { ERROR("Failed to allocate superblock\n"); goto failure; } - memset(s->s_fs_info, 0, sizeof(struct squashfs_sb_info)); msblk = s->s_fs_info; if (!(msblk->stream.workspace = vmalloc(zlib_inflate_workspacesize()))) { ERROR("Failed to allocate zlib workspace\n"); @@ -1257,16 +1256,14 @@ if (sblk->s_major == 1 && squashfs_1_0_supported(msblk)) goto allocate_root; - if (!(msblk->fragment = kmalloc(sizeof(struct squashfs_fragment_cache) * + if (!(msblk->fragment = kzalloc(sizeof(struct squashfs_fragment_cache) * SQUASHFS_CACHED_FRAGMENTS, GFP_KERNEL))) { ERROR("Failed to allocate fragment block cache\n"); goto failed_mount; } for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) { - msblk->fragment[i].locked = 0; msblk->fragment[i].block = SQUASHFS_INVALID_BLK; - msblk->fragment[i].data = NULL; } msblk->next_fragment = 0;