brcm80211: smac: Use kmemdup rather than duplicating its implementation
Subsystems (3)
PATCH 1/1 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 <[email protected]>
---
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c 2011-11-08 10:44:56.761349456 +0100 renamed from drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c 2011-11-07 19:39:05.641131954 +0100 +1 -2
@@ -1561,11 +1561,10 @@ int brcms_ucode_init_buf(struct brcms_in 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; } }
Quoted 5 lines · Thomas Meyer
The semantic patch that makes this change is available in
scripts/coccinelle/api/memdup.cocci.Signed-off-by Thomas Meyer<[email protected]>---
Thanks Thomas.
Acked-by Franky Lin <[email protected]>
Franky