summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/broadcom
diff options
context:
space:
mode:
authorMuhammad Falak R Wani <falakreyaz@gmail.com>2016-05-19 19:29:03 +0530
committerKalle Valo <kvalo@codeaurora.org>2016-06-14 17:26:48 +0300
commitd464fd8b48f322223ba12e0d3eb0a2e007eaf03e (patch)
treeaa25a4dc30ae9b09728997e30756c47b7cbeae17 /drivers/net/wireless/broadcom
parent2cce76c3fab410520610a7d2f52faebc3cfcf843 (diff)
downloadlinux-d464fd8b48f322223ba12e0d3eb0a2e007eaf03e.tar.gz
linux-d464fd8b48f322223ba12e0d3eb0a2e007eaf03e.tar.bz2
linux-d464fd8b48f322223ba12e0d3eb0a2e007eaf03e.zip
brcmfmac: use kmemdup
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 <falakreyaz@gmail.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 87819b32831d..16271c2300e9 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6714,11 +6714,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))