Commit 3ea60ab5 authored by HariPrasath Elango's avatar HariPrasath Elango Committed by Greg Kroah-Hartman

staging: wilc1000: use kmemdup instead of kmalloc and memcpy

Kmalloc followed by memcpy can be replaced by kmemdup.
Signed-off-by: default avatarHariPrasath Elango <hariprasath.elango@gmail.com>
Reviewed-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 50413119
......@@ -147,7 +147,7 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
if (!mgmt_tx)
return -ENOMEM;
mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
mgmt_tx->buff = kmemdup(buf, len, GFP_ATOMIC);
if (!mgmt_tx->buff) {
kfree(mgmt_tx);
return -ENOMEM;
......@@ -155,7 +155,6 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
mgmt_tx->size = len;
memcpy(mgmt_tx->buff, buf, len);
wilc_wlan_txq_add_mgmt_pkt(dev, mgmt_tx, mgmt_tx->buff, mgmt_tx->size,
mgmt_tx_complete);
......
Markdown is supported
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