Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);