All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pstore: Remove a redundant zeroing of memory
@ 2022-03-22 20:25 Christophe JAILLET
  0 siblings, 0 replies; only message in thread
From: Christophe JAILLET @ 2022-03-22 20:25 UTC (permalink / raw
  To: Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET

pstore_record_init() already call memset(0) on its 1st argument, so there
is no need to clear it explicitly before calling this function.

Use kmalloc() instead of kzalloc() to save a few cycles.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 fs/pstore/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index e26162f102ff..82eaf5a121a9 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -749,7 +749,7 @@ void pstore_get_backend_records(struct pstore_info *psi,
 		struct pstore_record *record;
 		int rc;
 
-		record = kzalloc(sizeof(*record), GFP_KERNEL);
+		record = kmalloc(sizeof(*record), GFP_KERNEL);
 		if (!record) {
 			pr_err("out of memory creating record\n");
 			break;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-22 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 20:25 [PATCH] pstore: Remove a redundant zeroing of memory Christophe JAILLET

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.