Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1173892ybi; Sat, 15 Jun 2019 22:34:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWWT0La27LWbkgu5+Xj55eJHgeE5NnVoGqXVFZ7XpccBmewRYWjiTWmC/aBhkx68lJB3ZR X-Received: by 2002:a62:5105:: with SMTP id f5mr107603661pfb.127.1560663295542; Sat, 15 Jun 2019 22:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560663295; cv=none; d=google.com; s=arc-20160816; b=rRRSWGfBeh204TcWD7+29qPhvmohe0I7Edy7KmNeehwZOYZIa818HyThaHUJL81cRT HunpTDeVHO6BGZUo9Uc1GOdsIzRVlPxiMH4Qmmv5NzW93xyVysnsM+cD3mxA7b13wju0 lGyiyCMMVSdG7EFpVM+fXVTV4apbSGCccIh1o6g5+mduQi8enjzapAiPbBGTRW5MmfvG bmoHZB8Mjbztf3ZANNGHoJPOMV07p0vG4MGM+t4DClmAeR6NKXTs/YQzSmNLMAj2Fgh/ V+yyHMGbfcBvBe8EHZvtNOTFZehqXpDfVwFCHcWzg6/QhXiWt2VCRa9jbboeDTMNEC22 iHDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=mzA6YGK114GVMFQzrNpNT//3gdsVz7F+WL+F5wNK5UE=; b=O6uaPmr3ai0l2rwxZN0OZplojaVHaSVXvn1rlggcN9EyfvsIhY32wdH063qylfBm1P doRjITKg8KeCA3gLTCUSCgOCae0I78kf0/Qi3ta2xeSkoPRf75fkyXABTnbMllCgOiWi 6XzGxP/mBSWR5JpJDaYIccGyPtrmOH3bMmegRyb4xcEHJyla8wlZTU+zcath/2Boqabg lD86PUiPSQDwmQgsluuQC1i+P+YOfpy2VhWQVeIuOv/s9yBA520lfSk7GTIqzQkW7m39 YHVK6Lkg6Ri/zIznW1XHiIkIu5sD+bdAan2oPLcdWYl2nwWpU723CdqEaX2iVCUSCyZ7 FGeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="LYu/+NVw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e96si6748811plb.123.2019.06.15.22.34.40; Sat, 15 Jun 2019 22:34:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="LYu/+NVw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725957AbfFPFc4 (ORCPT + 99 others); Sun, 16 Jun 2019 01:32:56 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45170 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725773AbfFPFc4 (ORCPT ); Sun, 16 Jun 2019 01:32:56 -0400 Received: by mail-pg1-f195.google.com with SMTP id s21so3900408pga.12 for ; Sat, 15 Jun 2019 22:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=mzA6YGK114GVMFQzrNpNT//3gdsVz7F+WL+F5wNK5UE=; b=LYu/+NVwSLjv4s670OLSv8HTPOpogxzRVgy5uyO+17vtePiBW2qxQMesQnBnyviEEZ Zwsm/ia7xgwFCATgBvwxJmSzG6mBIt7xNSmpsbonMzv7MKtfOJc7R/a7ozuQYmURwwJB 7dnG59e9eU5HbsSxqvuBy8Qn1T3c79ltpJe6DDIuBSQ+NnikKYaTC/6JMfOf9M9Jlm7+ pU4eHv6W4jit1V21AZY3PF2V30N6F6rQI7eo0O7fso/BeqDFx4NkOwaLg8k8OLCp9Fbj rajP7MTDZWhY5KFup2ymhhvG1I2GKXMlXnQfJOlIFpeOMCtXIjuH82FeWK8Kao4I0uSY F9wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=mzA6YGK114GVMFQzrNpNT//3gdsVz7F+WL+F5wNK5UE=; b=iMLnwKD3Bmtl/Npxu9dksj6yI/rLjWAd9bX4x+HTwGgHqPPGaJ0EHeW21KxDpBOWw0 eBgnmLbFWK+OmhKzj7mnBWTveKx7dEzQ/w1964TL8Ax6v4TbhGMd5EoQTyvuKVMFMggS RMpqXEGHf6AnaWPVhqOd4Hwn+Dtz7xbHc8I+YbtOta9XYOrIlUcGOZGa8xvzrqHo8DqC Nh/3iJP362ywSovuhYAkmARJApTwDmHdl36lcip4XG7p9wsPeOmqoNd6w7SoSI0W2onR jjb64GJ0DV0A1llPxB0Y4bNgoDOCZ2bkjWuODISFrfMgiIWOiyByj7w90Z4xL7mZlQ2n Nehw== X-Gm-Message-State: APjAAAX6efJoyCS/XccSAmjrCeAi3IGEXZqfcGh9zEb6xKj3mjC5xu1w k28CPyDLOz81CRiuVf3zA0o= X-Received: by 2002:a63:dc56:: with SMTP id f22mr28014541pgj.305.1560663175751; Sat, 15 Jun 2019 22:32:55 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.89.153]) by smtp.gmail.com with ESMTPSA id c9sm8305651pfn.3.2019.06.15.22.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jun 2019 22:32:55 -0700 (PDT) Date: Sun, 16 Jun 2019 11:02:50 +0530 From: Hariprasad Kelam To: Greg Kroah-Hartman , Michael Straube , Hariprasad Kelam , Mamta Shukla , Shobhit Kukreti , Emanuel Bennici , Puranjay Mohan , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723bs: os_dep: ioctl_linux: Make use rtw_zmalloc Message-ID: <20190616053250.GA16116@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtw_malloc with memset can be replace with rtw_zmalloc. Signed-off-by: Hariprasad Kelam --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index fc3885d..c59e366 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -478,14 +478,12 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, if (wep_key_len > 0) { wep_key_len = wep_key_len <= 5 ? 5 : 13; wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial); - pwep = rtw_malloc(wep_total_len); + pwep = rtw_zmalloc(wep_total_len); if (pwep == NULL) { RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (" wpa_set_encryption: pwep allocate fail !!!\n")); goto exit; } - memset(pwep, 0, wep_total_len); - pwep->KeyLength = wep_key_len; pwep->Length = wep_total_len; @@ -2144,12 +2142,10 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, int ret = 0; param_len = sizeof(struct ieee_param) + pext->key_len; - param = rtw_malloc(param_len); + param = rtw_zmalloc(param_len); if (param == NULL) return -1; - memset(param, 0, param_len); - param->cmd = IEEE_CMD_SET_ENCRYPTION; memset(param->sta_addr, 0xff, ETH_ALEN); @@ -3521,14 +3517,12 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, if (wep_key_len > 0) { wep_key_len = wep_key_len <= 5 ? 5 : 13; wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial); - pwep = rtw_malloc(wep_total_len); + pwep = rtw_zmalloc(wep_total_len); if (pwep == NULL) { DBG_871X(" r871x_set_encryption: pwep allocate fail !!!\n"); goto exit; } - memset(pwep, 0, wep_total_len); - pwep->KeyLength = wep_key_len; pwep->Length = wep_total_len; -- 2.7.4