Skip to content

Commit c8d25d6

Browse files
tititiou36kees
authored andcommitted
pstore/zone: Don't clear memory twice
There is no need to call memset(..., 0, ...) on memory allocated by kcalloc(). It is already zeroed. Remove the redundant call. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/fa2597400051c18c6ca11187b0e4b906729991b2.1709972649.git.christophe.jaillet@wanadoo.fr Signed-off-by: Kees Cook <[email protected]>
1 parent 98bc7e2 commit c8d25d6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/pstore/zone.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,6 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
12171217
pr_err("allocate for zones %s failed\n", name);
12181218
return ERR_PTR(-ENOMEM);
12191219
}
1220-
memset(zones, 0, c * sizeof(*zones));
12211220

12221221
for (i = 0; i < c; i++) {
12231222
zone = psz_init_zone(type, off, record_size);

0 commit comments

Comments
 (0)