Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp211986pxb; Wed, 23 Mar 2022 16:33:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4OyLmhNTdF1fNVXsR8xiGqMaTTNJ6uVudhbYz0HuvvCC1MerkSLdoGkIU4Fs9ohXXx0US X-Received: by 2002:a17:907:3f86:b0:6df:ad43:583 with SMTP id hr6-20020a1709073f8600b006dfad430583mr2789781ejc.535.1648078426014; Wed, 23 Mar 2022 16:33:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648078426; cv=pass; d=google.com; s=arc-20160816; b=sJfX82RxvZZbKIFfi5DbTx0BDPF67TGIu4fy9z9vRB5DOkQqIWSqsXLtpUkG8OQ9Mn FrcxdPpS4Bebta1DzoVYy6GDZrTeLJS7NDvGNaHhwyLy3GeyaAbjgFTECPHVJEgOESCr vqvvSalwvFaGf6jd5YEakjApDlUjeDiBtR51x08uODwbkJ/IEa9W//Gb9j0gA1v7VHMh sUowUCPsehQPk3rWMM1RkqSugMrBfJjxDYmobgBKuj78FQBH5Xsitehws2DLj2gpxkZe 8XsZqFPIzHoqyU/SP+Xs0/+qrDrbyh4D5ofNwaqv/I9D40re/zL8yvzuEwrd/9J0+sU6 YzkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=+fudnmKkJ7Uy7IfF9nWwvy6585PwbIkoAq9ENd5DZhg=; b=joVS1JAK5DNY+tgu1ZW6mVeSErVVHMhnfbPCQurm9QqvvUgINR3IvCuOCwP8tYX58A VhqHNYuaEfkmrR8wrVyoQSZOJrEzEGSB1rmpJ9H8/JmOBPSPveqA7xXIGrwq+R71IfWL qWSeuAusiaIL/izlJu/uRkDfQIISEtQ0JIBjui8LHf4fpti7/pB0QY9PldjGaAF3XUNb HZ8LYZwGaETK3XRC2nJsy9OuP+7Smh4O9/UTZjVkYCesJhZcSz9XBX/NwZ4RaaRHwMq9 Owk7L/EcWMKpaGzfNn2f/7I2y8L7K/yGuJMlKZ40YywHgIJpigCgV1TJVJMGKEiC2S9U GkRQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=aeiEqLBS; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="ryb5/IkX"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju20-20020a17090798b400b006df76385e47si12736108ejc.743.2022.03.23.16.33.20; Wed, 23 Mar 2022 16:33:45 -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; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=aeiEqLBS; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="ryb5/IkX"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242022AbiCWGx0 (ORCPT + 99 others); Wed, 23 Mar 2022 02:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232801AbiCWGxY (ORCPT ); Wed, 23 Mar 2022 02:53:24 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D4D71ED7; Tue, 22 Mar 2022 23:51:54 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22N2OeOe017302; Wed, 23 Mar 2022 06:51:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=+fudnmKkJ7Uy7IfF9nWwvy6585PwbIkoAq9ENd5DZhg=; b=aeiEqLBSudcrHZQcMRYzWhLHmWY2F9ifRQLiD82Cnbx84osjutMs0rCXRNjBfNLTHgBV yTdngNz0GzKKhQ3aw2VwO+Sy/L2XEiTHnVOfnERQsBsJULxEX6XWLSvs8iSHcpfwgS41 vSHy77wzKjR5n+n5/ibWurcC4/uzdAkKLUHXUQKxG7IqsPo+oXYGQeREFtO4klkJmtQS 04oKG72UcjpnS4hcGTOj3nOJtmB1CmGPA+FhEd/nAnBmiMnz5nuiwKbhmTYQANpWyVFU 6bb0xBqNJzf5yAPrLak4jFY4Dksxwx6505FEGn6QDqGsHEvIXXfm8O8oDBuY6NHnKJqS 6A== Received: from aserp3030.oracle.com ([141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3ew5kcrdxv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Mar 2022 06:51:34 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22N6kmsD144641; Wed, 23 Mar 2022 06:51:34 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by aserp3030.oracle.com with ESMTP id 3ew578w979-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Mar 2022 06:51:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZNb7i4spxrU0ooVpvyRk4TfPxA31gPcY0an0i6xuFQNBchfq31QwFE0x3gDd/hY/EAFmians5rdx0B13HeaR7nIzC84+Q1Iq25zvGGrKLUO1kZ4b3Fd280Anb4iFZ0v393xBfvJp5ibfEwi4AR0At1itlOVCKBSSu8VaC3r5HGNtXsBn+tqxvwDyl160BPFxJAqNXnYmSOyBxLV6GMqAR2Wn7BQ0HK0vHSlVyk7Vpcoe9PZwDU9+1n9Hasgbkogs35PSST/OSUGFraVNTCudcdXqsrKf47EBaV4i2BVMY5Jq9nsQnWTh25Wf+lzHTxyxCFU63qZ6cfLdDja17PLwQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+fudnmKkJ7Uy7IfF9nWwvy6585PwbIkoAq9ENd5DZhg=; b=VeoWS1iLuFPdNpvQqRIPvFd+keJ95Py0Ns6r6o6OXB3FXb/0R8hfOvNmzlUbGrlmqnjLha3KS7//LlCMx0pX8SCAWyzrYCyTe1I8pcki58bBla32aJUVP9b1ih5c1RmM+ijFMlEY7csKzn5HGHh2uQgUdLEecJ9kb2JUB0TOi+z29l8rfwyoiN8UMYExHNJouMD0Qfc5jOhTFre5NaPDE9CDEJ6Q/PLlhG7v28pIkCV5T0KG+3RxRiQ84bMb1QZbbnToEMYA+wbVtQhdzP3LtqoEuWr2B7pLHDDE7M1hzmMlPpFSSoXJxCJVlShcJFlbMk43IKWkgp1u2AQPDJIwqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+fudnmKkJ7Uy7IfF9nWwvy6585PwbIkoAq9ENd5DZhg=; b=ryb5/IkX4QALOaSnRzMu46wxqqemJPh1vUw2gZobsmC0hVoz10JzayHChgM+1TE+05+Qg+haEdX718eiv55sZTVSFcrIJZPC7rw0BVSQIfBkMvjG7oJVB9yTMw+sQHzX4IIzVJuAvAVqFj5uWezjEy5OqfH/6ORcGF6DMTjDvJs= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by SN6PR10MB2975.namprd10.prod.outlook.com (2603:10b6:805:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Wed, 23 Mar 2022 06:51:32 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::d4e7:ee60:f060:e20c]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::d4e7:ee60:f060:e20c%7]) with mapi id 15.20.5081.023; Wed, 23 Mar 2022 06:51:31 +0000 Date: Wed, 23 Mar 2022 09:51:11 +0300 From: Dan Carpenter To: Christophe JAILLET Cc: Namjae Jeon , Sergey Senozhatsky , Steve French , Hyunchul Lee , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-cifs@vger.kernel.org Subject: Re: [PATCH] ksmbd: Remove a redundant zeroing of memory Message-ID: <20220323065111.GO3293@kadam> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: MR1P264CA0020.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:2f::7) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50f86ed4-2caa-47cf-85ce-08da0c998ff5 X-MS-TrafficTypeDiagnostic: SN6PR10MB2975:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LgXY7UJVwM0a3w/5VPAwy/fqWxU7vWg8gW4WgOtTE/AegOq8enTsGZXFZEK1EAx6E9ltesu7ouOb0jfIhs7x+VXAnoDnzYTfNkIB7u3COwZcwAueqHPnZQqBL7WpF5ojB5exh7vSwWIpXsQgfNqBZBQfFzMRyozDR9kdldnAukZjOTy4CdviGEgUxsKjCIGeKNYBkkR8HI/4X9QfzQITW8soL9pV+pmrWVT66L9TqrSrbeyrnKXiPFOaynapuc2rIn3dqfxx747He04DhJOCrjI0BQVUh2tj600TncVb5zZfmrNMwvwnfUUARNDKNsRB8vNtMVac3kEkZ02hjNd52Jx+2gynYgugC2PCD1xt+JKSXQUp73VGTCNEHoCjE06PHHO2nKLAsFdPcyWbw2wGwuGcSWQuGwZIUfRjZbt85JqovKUCPS7e+NZ3ZYb24Gjs2NGd4chsu70xXZUKfxDc0ZUfY06tukTt0skE3E3mswvCRGzQ2lRaBxrViSTb9TXfI2GYqBAZDciwylb+6BVJzp4JwfD4kGmpj696n38qr6JDwhhOKlULGKxv9eC9H/+oXF4SDmX2knRL7nMHYcdvy9k1ENS8oEjdhaovdnWEAXvMcWrBVWs+dt4YEIZhbZKI+pEM9MB8+cU7yublWA8Jgi5F7b3ZcT56sdg84RFIKH/36hELtof5FlJ4QNExziHDAf69QSurRJtWztxoO0VfEg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(26005)(8936002)(66946007)(6666004)(6916009)(54906003)(33716001)(9686003)(6512007)(86362001)(66556008)(66476007)(186003)(38100700002)(8676002)(38350700002)(33656002)(316002)(508600001)(52116002)(2906002)(5660300002)(6506007)(83380400001)(6486002)(1076003)(44832011)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?TVaWIINFOahwbDxY51O+8KdioNfV/aUXTVuK4YlzCK0/oRwAIFsun1r9AkCM?= =?us-ascii?Q?wF6YaiwOV/wVhv+sa5oL7W+GRatg1V5Soeje6CkUeB5TXwasYOmp0q2q53X5?= =?us-ascii?Q?HehHbAvxRE29XSwLGu0Fb7yTHGNC5yiRPooJkekFuTqVXFsAaMUTZOdDLFGF?= =?us-ascii?Q?F2qil7xSG1uwwEDFmjRaf2HgE8dtItRxocZXWD7MTAsJ5iD7BWzKIWpU7KjQ?= =?us-ascii?Q?BrTGUKa5JnQMWQmhCkZgDIvHOlJwU3AYA9e2KRS7X6kDVggfxyRIr/pELRci?= =?us-ascii?Q?jCcNaxf4Ey7HfOTxcgL+KSfLFjKWfnZV9qB+cZE28zRoVwsMeQe4HRCs7FXP?= =?us-ascii?Q?OVmvC57GFQh6zvD+9WZIY/Iurjy+HV965d78LKd68ufX/s54HhnexH1pW3Se?= =?us-ascii?Q?AIj9lKPdpidC6v5fwWO8gzqSiapMlfRPltbIlndzUfyH/mUCbeEnutgIyzYi?= =?us-ascii?Q?GgV5CaGeDxTU/oSIbWjJfdyabGmSJwWnm+ffE05VzeB4CHC93J+mw2Yjb3uY?= =?us-ascii?Q?kEF/na66JqzWRLLSuNf0ppqrH5SrjEr1neHA92caXFua0PkfcOBbTE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rerS4WwdRnLx+ueBuck3blnaJhlPtcTeRNDDZUmg=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50f86ed4-2caa-47cf-85ce-08da0c998ff5 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2022 06:51:31.5014 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CQWqdDHCSJHZRTqjGkifNaD9BqGiVgk/kVO4348XQz/UUZYigS10FAaahf2FMwFiMmje8AKzXeMnDJZeqTnfZeh8xlzAtVvqIbaRo0VItZ0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2975 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10294 signatures=694350 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203230038 X-Proofpoint-GUID: D02bvtlzgTBq0FFQQwDEt1bAZM5VZSwD X-Proofpoint-ORIG-GUID: D02bvtlzgTBq0FFQQwDEt1bAZM5VZSwD X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 On Tue, Mar 22, 2022 at 09:29:51PM +0100, Christophe JAILLET wrote: > 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); ^^^ fill_transform_hdr() does not clear the last 4 bytes. regards, dan carpenter