diff options
author | HariPrasath Elango <hariprasath.elango@gmail.com> | 2018-03-14 15:45:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-19 21:45:31 +0300 |
commit | 3ea60ab5fad247c9f260afdb1ef775e908529bf5 (patch) | |
tree | 2d676341cf4a929a117abc6e0d2053b0efca8bf5 /drivers/staging/wilc1000 | |
parent | 50413119b614209b40d6e234e74d101a80aa8378 (diff) | |
download | linux-3ea60ab5fad247c9f260afdb1ef775e908529bf5.tar.xz |
staging: wilc1000: use kmemdup instead of kmalloc and memcpy
Kmalloc followed by memcpy can be replaced by kmemdup.
Signed-off-by: HariPrasath Elango <hariprasath.elango@gmail.com>
Reviewed-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/linux_mon.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index bbdfc7aab677..47e3025d616c 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -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); |