Received: by 2002:a05:6512:e85:0:0:0:0 with SMTP id bi5csp2874508lfb; Thu, 23 Jun 2022 13:43:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uVJBVkylFWtXNZluq0M2JxQNKCB3lWuH9Hqezj4vlm+ptdmsBEJvVdzQT5tarPzJUf8Fmu X-Received: by 2002:a17:90b:1c82:b0:1dd:1b46:5aa9 with SMTP id oo2-20020a17090b1c8200b001dd1b465aa9mr5912732pjb.158.1656016984630; Thu, 23 Jun 2022 13:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656016984; cv=none; d=google.com; s=arc-20160816; b=c916V+5ZLoQ8V2TvcDi0rmNVlWudEVgiA94fX6E6hwK2tcGnApZn4jODNhIRCh5erw QRVsSmEfpOJ7+weBno9US5U4zijgKYRLOKMs+ezSVrLBxD/hq5reOlBrCyVrzT+U5N9c 8eOuozMRUctM9a+ONiEWpCzh95iW7o+9y+hSsF/QR8yJN7fdw9oix8orlw1OEsnYTggi ajVoaE+xp8fJKJMuFuJfZYnSEHTy2fg9rdDaycbiC5BPZg61LviIGvy2K0ct3Hhu83uf EpJyP6kzLkRLIE7A19hMaMkinnT2/G1ynHSSZ2D5GUMI9aXIj+PCQV5CGpn7c+vUORws iyjg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-hdrordr:ironport-data; bh=v5KgDpnFfukyo2JjpZ39r1xxGFxbCzXHBbU2i6LiqU4=; b=v4YIm3iWF9k2uBsGi8/o+7npIrNpDi4apOJOh80fdUs8zDVP4Es6j34ANqBr4BcX+4 y3QhVySQC4HAOGjO4bt/OeCxHc86reuPqMztpCiKUvh3u8bBg/sC+GdyyNsUzBO0RWxz taYyEYjSYCnH/XbrCfz4DwYQz5x3hB+k/m9ys9s+QLDGuj0iv9yQSrjXJVApPdMmglET fIViG/ePOPDAfirgncsxv72w7O+YbjzeKo8TA9FES+EiSCNs7DWzcuXTellovU6TY5yv FefaxcDR8Bq1a3Xu+nvZn3gkt7jix8qYMWl/H4Y8msp5Skl8Q+8iPuw0WimvwckAb0Xv HyYg== 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a056a00194c00b00525263e8d8fsi228464pfk.321.2022.06.23.13.42.52; Thu, 23 Jun 2022 13:43:04 -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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbiFWU3Z (ORCPT + 99 others); Thu, 23 Jun 2022 16:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiFWU3T (ORCPT ); Thu, 23 Jun 2022 16:29:19 -0400 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4617D54BC0 for ; Thu, 23 Jun 2022 13:29:18 -0700 (PDT) X-IPAS-Result: =?us-ascii?q?A2CyBgCJzLRiffxkzoFagliEfJQPAQEBBoxtA4cciieCB?= =?us-ascii?q?wEBAQEBAQEBAQlCBAEBPQECig8nNgcOAQIEAQEB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lzuZ1UXxUsoiN6cUCrG/oHnRzbU= IronPort-HdrOrdr: A9a23:wAuv5Kv+9g13he4+zUqQRnNS7skDYdV00zEX/kB9WHVpmwKj+/ xG+85rsSMc5wx+ZJhNo7q90ey7MBDhHP1OkOws1MmZPTUO0VHAROpfBMnZsl/d8kbFmdK1u5 0MT0EHMr3NMWQ= X-IronPort-Anti-Spam-Filtered: true Received: from mail01.uni-heidelberg.de ([129.206.100.252]) by relay.uni-heidelberg.de with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jun 2022 22:28:02 +0200 Received: from localhost (ip-037-209-006-204.um11.pools.vodafone-ip.de [37.209.6.204]) (Authenticated sender: ln194) by mail01.uni-heidelberg.de (Postfix) with ESMTPSA id 66D69300719FC; Thu, 23 Jun 2022 22:28:01 +0200 (CEST) From: Felix Schlepper To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Felix Schlepper Subject: [PATCH v4 2/3] Staging: rtl8192e: Using kzalloc and delete memset Date: Thu, 23 Jun 2022 22:27:54 +0200 Message-Id: <9727fe31c675f2f3052ca2fa586d137dd856ac91.1655975970.git.f3sch.git@outlook.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,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 By using kzalloc, we can delete a memset. The practical difference is that using kzalloc() will zero out the txb->fragments[] array. The original code worked fine, but zeroing everything seems nicer. Signed-off-by: Felix Schlepper --- drivers/staging/rtl8192e/rtllib_tx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index f2ef32e943ae..1307cf55741a 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -205,11 +205,10 @@ static struct rtllib_txb *rtllib_alloc_txb(int nr_frags, int txb_size, struct rtllib_txb *txb; int i; - txb = kmalloc(struct_size(txb, fragments, nr_frags), gfp_mask); + txb = kzalloc(struct_size(txb, fragments, nr_frags), gfp_mask); if (!txb) return NULL; - memset(txb, 0, sizeof(struct rtllib_txb)); txb->nr_frags = nr_frags; txb->frag_size = cpu_to_le16(txb_size); -- 2.36.1