summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-08-09 08:44:29 +0200
committerStefan Schmidt <stefan@datenfreihafen.org>2018-09-21 10:52:15 +0200
commit5b3686c7aaade973b8806dba4ecc99bec8c988f3 (patch)
tree729dc156e0e147bdb1ae3bc4db752c4ae70d1bfb /drivers/net
parentr8169: fix autoneg issue on resume with RTL8168E (diff)
downloadlinux-5b3686c7aaade973b8806dba4ecc99bec8c988f3.tar.xz
linux-5b3686c7aaade973b8806dba4ecc99bec8c988f3.zip
ieee802154: Use kmemdup instead of duplicating it in ca8210_test_int_driver_write
Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ieee802154/ca8210.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 58299fb666ed..e21279dde85c 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -634,10 +634,9 @@ static int ca8210_test_int_driver_write(
for (i = 0; i < len; i++)
dev_dbg(&priv->spi->dev, "%#03x\n", buf[i]);
- fifo_buffer = kmalloc(len, GFP_KERNEL);
+ fifo_buffer = kmemdup(buf, len, GFP_KERNEL);
if (!fifo_buffer)
return -ENOMEM;
- memcpy(fifo_buffer, buf, len);
kfifo_in(&test->up_fifo, &fifo_buffer, 4);
wake_up_interruptible(&priv->test.readq);