Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751345AbdH1LGW (ORCPT ); Mon, 28 Aug 2017 07:06:22 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34642 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdH1LGV (ORCPT ); Mon, 28 Aug 2017 07:06:21 -0400 From: Himanshu Jha To: gregkh@linuxfoundation.org Cc: insafonov@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] staging: rtl8188eu: remove unnecessary call to memset Date: Mon, 28 Aug 2017 16:36:02 +0530 Message-Id: <1503918362-9253-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1809 Lines: 46 call to memset to assign 0 value immediately after allocating memory with kzalloc is unnecesaary as kzalloc allocates the memory filled with 0 value. Signed-off-by: Himanshu Jha --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 3 --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index fde3060..7397167 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1566,7 +1566,6 @@ int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv) res = _FAIL; goto exit; } - memset(psetauthparm, 0, sizeof(struct setauth_parm)); psetauthparm->mode = (unsigned char)psecuritypriv->dot11AuthAlgrthm; pcmd->cmdcode = _SetAuth_CMD_; pcmd->parmbuf = (unsigned char *)psetauthparm; @@ -1601,8 +1600,6 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in goto err_free_cmd; } - memset(psetkeyparm, 0, sizeof(struct setkey_parm)); - if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { psetkeyparm->algorithm = (unsigned char)psecuritypriv->dot118021XGrpPrivacy; RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 763eccd..c0664dc 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -2166,8 +2166,6 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid) goto exit; } - memset(psetkeyparm, 0, sizeof(struct setkey_parm)); - psetkeyparm->keyid = (u8)keyid; psetkeyparm->algorithm = alg; -- 2.7.4