Ver código fonte

fsnotify: kzalloc fsnotify groups

Use kzalloc for fsnotify_groups so that none of the fields can leak any
information accidentally.

Signed-off-by: Eric Paris <eparis@redhat.com>
Eric Paris 15 anos atrás
pai
commit
f0553af054
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      fs/notify/group.c

+ 1 - 1
fs/notify/group.c

@@ -207,7 +207,7 @@ struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num, __u32 mask,
 	struct fsnotify_group *group, *tgroup;
 	struct fsnotify_group *group, *tgroup;
 
 
 	/* very low use, simpler locking if we just always alloc */
 	/* very low use, simpler locking if we just always alloc */
-	group = kmalloc(sizeof(struct fsnotify_group), GFP_KERNEL);
+	group = kzalloc(sizeof(struct fsnotify_group), GFP_KERNEL);
 	if (!group)
 	if (!group)
 		return ERR_PTR(-ENOMEM);
 		return ERR_PTR(-ENOMEM);