Commit c8d25d69 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Kees Cook

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/fa2597400051c18c6ca11187b0e4b906729991b2.1709972649.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarKees Cook <keescook@chromium.org>
parent 98bc7e26
...@@ -1217,7 +1217,6 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type, ...@@ -1217,7 +1217,6 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
pr_err("allocate for zones %s failed\n", name); pr_err("allocate for zones %s failed\n", name);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
memset(zones, 0, c * sizeof(*zones));
for (i = 0; i < c; i++) { for (i = 0; i < c; i++) {
zone = psz_init_zone(type, off, record_size); zone = psz_init_zone(type, off, record_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment