Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3673113pxp; Wed, 23 Mar 2022 03:36:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT55+vGPLKlOrURZcHwPJtFOGsKhKUJEmq8pkBsQXOS6fesOVmN8yZBMJmD6j6xo2Gt1dk X-Received: by 2002:a17:906:5d05:b0:6df:f88c:ae96 with SMTP id g5-20020a1709065d0500b006dff88cae96mr16975041ejt.480.1648031791250; Wed, 23 Mar 2022 03:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648031791; cv=none; d=google.com; s=arc-20160816; b=iklBhXk5l8PHwSNESuvFNWygwONYFwsk8+loKBZffG5pKSpkweIzn2wu2RRtyX1eAr 8xviQTUUmFAmvaN2eDz4x1iI1hobk0sPF1poGHAUK0eE1a211IH5Z0t5SUdisqP7hJ/g iiYvc7woWqitLgAsYInn3Sd/mRsW+QtSEs93NT8BxyU+4/zK+bTAmhYyJfVM5F+frL8t SwIeKzEgdI0iRHlzLKc2i7oE4uungDj+Mkfts/DxHvghczY9AI/3qv3hAp4idcaupsrP 2B2kpbcRvxI6JKrMMPaZ5IWjXLoFOxVEwgzH9w6t2gnw8NsNqDvLxBFNvPMniQ8E6ICg RAIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ci5tOpfFg/iNIz2xUGtnP1cM0wA77ON2IQUrlasPU1c=; b=F6D+tuWyBePypi7Yqw/FBGLar1D53jekRJe2Jx3QuJSSj5JgnCOeTFEuKjbmIh3qRX whejqjHTcxx3uasDebiRTuIbroNc5m+LXZiO8NKjyDbZ0JOkb9oSs9IRpYHU1We7P+Ue 1TOS1TGz9NXjMaYa6h7SRNgmP7y1JBVGAO8zlO5lItbRdDpBFCtbqfMN6jMAijB+GoYC CLspOdFkFy+hK1SsAh5dhrIFRltHXdVTl41w3pXWROuPUiuLhXL2JJ2JwmvkChiQdJ5z BeFR6M3FQf+MqRX6AgeI4mpApoUBnEnnrKScFkqoXlRnMOJglMNanoWB3xzIrOtQEybb dXuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ko1-20020a170907986100b006df76385db4si11279841ejc.596.2022.03.23.03.36.05; Wed, 23 Mar 2022 03:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233761AbiCVUbY (ORCPT + 99 others); Tue, 22 Mar 2022 16:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233723AbiCVUbX (ORCPT ); Tue, 22 Mar 2022 16:31:23 -0400 Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAB3CC2 for ; Tue, 22 Mar 2022 13:29:55 -0700 (PDT) Received: from pop-os.home ([90.126.236.122]) by smtp.orange.fr with ESMTPA id Wl8anBpiiIQAdWl8an8q7V; Tue, 22 Mar 2022 21:29:53 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 22 Mar 2022 21:29:53 +0100 X-ME-IP: 90.126.236.122 From: Christophe JAILLET To: Namjae Jeon , Sergey Senozhatsky , Steve French , Hyunchul Lee Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-cifs@vger.kernel.org Subject: [PATCH] ksmbd: Remove a redundant zeroing of memory Date: Tue, 22 Mar 2022 21:29:51 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fill_transform_hdr() 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 --- Alternatively, fill_transform_hdr() has only one caller. So its memset() could be removed instead and this kzalloc() left as is. --- fs/ksmbd/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index bcb98109bac9..0e4f819e5859 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -8434,7 +8434,7 @@ int smb3_encrypt_resp(struct ksmbd_work *work) if (ARRAY_SIZE(iov) < rq_nvec) return -ENOMEM; - work->tr_buf = kzalloc(sizeof(struct smb2_transform_hdr) + 4, GFP_KERNEL); + work->tr_buf = kmalloc(sizeof(struct smb2_transform_hdr) + 4, GFP_KERNEL); if (!work->tr_buf) return rc; -- 2.32.0