Commit 5b3686c7 authored by YueHaibing's avatar YueHaibing Committed by Stefan Schmidt

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: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
parent 10bc6a60
......@@ -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);
......
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