diff options
author | Thomas Meyer | 2011-11-17 23:43:40 +0100 |
---|---|---|
committer | John W. Linville | 2011-11-21 22:20:46 +0100 |
commit | 1f1d528977162a1a04aaecdc7f08a5b715a58810 (patch) | |
tree | 5a331ce8b8d167a65a84699b8b4cec5d75862cd1 /drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |
parent | rtlwifi: Remove redundant code from PCI interrupt (diff) | |
download | kernel-qcow2-linux-1f1d528977162a1a04aaecdc7f08a5b715a58810.tar.gz kernel-qcow2-linux-1f1d528977162a1a04aaecdc7f08a5b715a58810.tar.xz kernel-qcow2-linux-1f1d528977162a1a04aaecdc7f08a5b715a58810.zip |
brcm80211: smac: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Acked-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index 6d3c7b6c5aa0..922c5d969a5b 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c @@ -1549,11 +1549,10 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx) if (le32_to_cpu(hdr->idx) == idx) { pdata = wl->fw.fw_bin[i]->data + le32_to_cpu(hdr->offset); - *pbuf = kmalloc(len, GFP_ATOMIC); + *pbuf = kmemdup(pdata, len, GFP_ATOMIC); if (*pbuf == NULL) goto fail; - memcpy(*pbuf, pdata, len); return 0; } } |