From nobody Mon Jun 22 14:11:24 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 584CCC433F5 for ; Tue, 22 Mar 2022 20:25:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233681AbiCVU1L (ORCPT ); Tue, 22 Mar 2022 16:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233953AbiCVU0v (ORCPT ); Tue, 22 Mar 2022 16:26:51 -0400 Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BD766633 for ; Tue, 22 Mar 2022 13:25:13 -0700 (PDT) Received: from pop-os.home ([90.126.236.122]) by smtp.orange.fr with ESMTPA id Wl42nBncYIQAdWl43n8pUd; Tue, 22 Mar 2022 21:25:12 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 22 Mar 2022 21:25:12 +0100 X-ME-IP: 90.126.236.122 From: Christophe JAILLET To: Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] pstore: Remove a redundant zeroing of memory Date: Tue, 22 Mar 2022 21:25:09 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- 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; =20 - record =3D kzalloc(sizeof(*record), GFP_KERNEL); + record =3D kmalloc(sizeof(*record), GFP_KERNEL); if (!record) { pr_err("out of memory creating record\n"); break; --=20 2.32.0