From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752895AbbC3Pp1 (ORCPT ); Mon, 30 Mar 2015 11:45:27 -0400 Received: from mail-am1on0107.outbound.protection.outlook.com ([157.56.112.107]:38240 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752648AbbC3PpZ convert rfc822-to-8bit (ORCPT ); Mon, 30 Mar 2015 11:45:25 -0400 X-Greylist: delayed 2037 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 Mar 2015 11:45:25 EDT From: "Dhere, Chaitanya (C.)" To: "gregkh@linuxfoundation.org" , "navin.patidar@gmail.com" , "vthakkar1994@gmail.com" , "tapaswenipathak@gmail.com" , "dan.carpenter@oracle.com" , "abelmoyo.ab@gmail.com" CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] Staging: rtl8188eu: Replaced kzalloc and memcpy combination with kmemdup Thread-Topic: [PATCH] Staging: rtl8188eu: Replaced kzalloc and memcpy combination with kmemdup Thread-Index: AQHQavvK04GHRkQezUaRTP2EFtlSfg== Date: Mon, 30 Mar 2015 15:11:25 +0000 Message-ID: <20150330151119.GA9797@chaitanya-Ideapad-Z560> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [117.214.113.228] authentication-results: linuxfoundation.org; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR06MB028; x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(2860100001)(33716001)(77156002)(122556002)(2900100001)(19580405001)(46102003)(40100003)(86362001)(33656002)(19580395003)(106116001)(92566002)(54356999)(229853001)(66066001)(50986999)(102836002)(62966003)(2501003)(2656002)(87936001)(2201001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB3PR06MB028;H:DB3PR06MB028.eurprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:DB3PR06MB028;BCL:0;PCL:0;RULEID:;SRVR:DB3PR06MB028; x-forefront-prvs: 05315CBE52 Content-Type: text/plain; charset="us-ascii" Content-ID: <98A99AF8090DCA48A89F14B833D93EEA@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2015 15:11:26.0050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR06MB028 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This change was detected with the help of coccinelle tool. It performs the same function as kzalloc amd memcpy. Signed-off-by: Chaitanya Dhere --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 86d955f..07ae6cf 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -5431,15 +5431,14 @@ u8 set_tx_beacon_cmd(struct adapter *padapter) goto exit; } - ptxBeacon_parm = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL); + ptxBeacon_parm = kmemdup(&(pmlmeinfo->network), + sizeof(struct wlan_bssid_ex), GFP_KERNEL); if (ptxBeacon_parm == NULL) { kfree(ph2c); res = _FAIL; goto exit; } - memcpy(ptxBeacon_parm, &(pmlmeinfo->network), sizeof(struct wlan_bssid_ex)); - len_diff = update_hidden_ssid(ptxBeacon_parm->IEs+_BEACON_IE_OFFSET_, ptxBeacon_parm->IELength-_BEACON_IE_OFFSET_, pmlmeinfo->hidden_ssid_mode); -- 1.9.1