Commit 1f1d5289 authored by Thomas Meyer's avatar Thomas Meyer Committed by John W. Linville
Browse files

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: default avatarThomas Meyer <>
Acked-by: default avatarFranky Lin <>
Signed-off-by: default avatarJohn W. Linville <>
parent 0dcc3c84
......@@ -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 +
*pbuf = kmalloc(len, GFP_ATOMIC);
*pbuf = kmemdup(pdata, len, GFP_ATOMIC);
if (*pbuf == NULL)
goto fail;
memcpy(*pbuf, pdata, len);
return 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment