Skip to contentSkip to conversation

HFSPlus: change kmalloc/memset to kzalloc

PATCH New Wyatt Banks 1 participant 1 message Jun 4, 2007 Hfsplus filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HFSPlus: change kmalloc/memset to kzalloc

From: Wyatt Banks <[email protected]>

Removed kmalloc and memset in favor of kzalloc.

---

Patched against 2.6.21.3

To explain the HFSPLUS_SB() macro in the removed memset call:

hfsplus_fs.h:#define HFSPLUS_SB(super) (*(struct hfsplus_sb_info *)(super)->s_fs_info)

fs/hfsplus/super.c +0 -0
@@ -283,11 +283,10 @@ static int hfsplus_fill_super(struct sup
	struct nls_table *nls = NULL;
	int err = -EINVAL;

- sbi = kmalloc(sizeof(struct hfsplus_sb_info), GFP_KERNEL);

+	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
	if (!sbi)
		return -ENOMEM;
-	memset(sbi, 0, sizeof(HFSPLUS_SB(sb)));
	sb->s_fs_info = sbi;
	INIT_HLIST_HEAD(&sbi->rsrc_inodes);
	hfsplus_fill_defaults(sbi);