aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 9dcdf556c99c..9e95e7abaf69 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -37,11 +37,10 @@ static struct sysfs_dirent * __sysfs_new_dirent(void * element)
37{ 37{
38 struct sysfs_dirent * sd; 38 struct sysfs_dirent * sd;
39 39
40 sd = kmem_cache_alloc(sysfs_dir_cachep, GFP_KERNEL); 40 sd = kmem_cache_zalloc(sysfs_dir_cachep, GFP_KERNEL);
41 if (!sd) 41 if (!sd)
42 return NULL; 42 return NULL;
43 43
44 memset(sd, 0, sizeof(*sd));
45 atomic_set(&sd->s_count, 1); 44 atomic_set(&sd->s_count, 1);
46 atomic_set(&sd->s_event, 1); 45 atomic_set(&sd->s_event, 1);
47 INIT_LIST_HEAD(&sd->s_children); 46 INIT_LIST_HEAD(&sd->s_children);