Commit 5ff75c48 authored by YueHaibing's avatar YueHaibing Committed by Noralf Trønnes

drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer()

use kmemdup rather than duplicating its implementation
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1543471233-159568-1-git-send-email-yuehaibing@huawei.com
parent 77e9c35a
......@@ -108,12 +108,11 @@ static int repaper_spi_transfer(struct spi_device *spi, u8 header,
/* Stack allocated tx? */
if (tx && len <= 32) {
txbuf = kmalloc(len, GFP_KERNEL);
txbuf = kmemdup(tx, len, GFP_KERNEL);
if (!txbuf) {
ret = -ENOMEM;
goto out_free;
}
memcpy(txbuf, tx, len);
}
if (rx) {
......
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