From patchwork Thu May 19 13:59:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Falak R Wani X-Patchwork-Id: 9127677 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E2D160467 for ; Thu, 19 May 2016 13:59:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51B80267DE for ; Thu, 19 May 2016 13:59:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45F7A281C2; Thu, 19 May 2016 13:59:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F36C4267DE for ; Thu, 19 May 2016 13:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932168AbcESN70 (ORCPT ); Thu, 19 May 2016 09:59:26 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35014 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754895AbcESN7Z (ORCPT ); Thu, 19 May 2016 09:59:25 -0400 Received: by mail-pa0-f66.google.com with SMTP id rw9so8014774pab.2; Thu, 19 May 2016 06:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5EuGhKJAbSgdNKh8gB6ZzCwwMFI4tGk+kgq3nUI7mCk=; b=i3aob2DuCxmZh1DNdd2OAfCHv22E5g5F23ZQNA8lFqXnPWGC7VMJDPg7BoB1fZID/z qm2f0SYS0yBj6lQt4GuHwCVo2ZgwgAbLcvZ/bvjT5/AtFdFAMXfnJwSTc84+6lqec3kj Mqc+jitZTvwNHJtcRuCVDpAf+AFfqeSgiiRzbArIptcX4ijSuJuKBU8FBNncYD9OLv45 gKHe+dCUfSq2kiIXP50jBBzFJ3mGalTBPB5JUAdpVXZExv9zNtDCKgqp3ioG653LaVVr ++6/5D9BOLXTuON8l9Hyw6tFidOKZ3o5aN+2W854N6YayZv1349/QM7t91DByKbhaBnc S1jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5EuGhKJAbSgdNKh8gB6ZzCwwMFI4tGk+kgq3nUI7mCk=; b=EgsjgHnG1tTrUBCqoRqpAB3qXErViWB1Wa7LKa32rrAfGjS5Z3SK/n5md4A7D1aXEh rmLGCKMEPw2GyOlrv8rEf9e3p4Jf0VvAz1VJ0xhkb9Yjp3i2j3lPiMWoWT/hiG4FGdze srycQHtTpF+oecB5aX0baAwqIuVSuWYwXRmuHu/+sm5y65wHxgfH+ivwDR/8Rbm3V+Tr J3jI+FdZLyVN6qbKHLkd0BG72OC31t61ripQ/A/r8HS6C59IAqQzGAgeGo+Pxt5aTPSl vMBAzoEZdju25WVFj5EWto6RhYj8kFQd4KSfcUcuyf2f2cpGc1PKtddEJS6SUqzDYa/8 +c1w== X-Gm-Message-State: AOPr4FWL/fuHDN/UWOaH9vDHDZ0Pca5+sYGVDw+6YZrM8Ffok385BP9aA+oep52jfR3L0g== X-Received: by 10.66.26.37 with SMTP id i5mr20019466pag.15.1463666364181; Thu, 19 May 2016 06:59:24 -0700 (PDT) Received: from kp.domain.name ([110.235.28.83]) by smtp.gmail.com with ESMTPSA id z9sm20209184pfa.84.2016.05.19.06.59.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 06:59:23 -0700 (PDT) From: Muhammad Falak R Wani To: Kalle Valo Cc: Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , Pieter-Paul Giesberts , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] brcmfmac: use kmemdup Date: Thu, 19 May 2016 19:29:03 +0530 Message-Id: <1463666357-16719-1-git-send-email-falakreyaz@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use kmemdup when some other buffer is immediately copied into allocated region. It replaces call to allocation followed by memcpy, by a single call to kmemdup. Signed-off-by: Muhammad Falak R Wani Acked-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index d0631b6..705adaa 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6699,11 +6699,10 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, return NULL; } - ops = kzalloc(sizeof(*ops), GFP_KERNEL); + ops = kmemdup(&brcmf_cfg80211_ops, sizeof(*ops), GFP_KERNEL); if (!ops) return NULL; - memcpy(ops, &brcmf_cfg80211_ops, sizeof(*ops)); ifp = netdev_priv(ndev); #ifdef CONFIG_PM if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK))