Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1543471233-159568-1-git-send-email-yuehaibing@huawei.com

authored by

YueHaibing and committed by
Noralf Trønnes
5ff75c48 77e9c35a

+1 -2
+1 -2
drivers/gpu/drm/tinydrm/repaper.c
··· 108 108 109 109 /* Stack allocated tx? */ 110 110 if (tx && len <= 32) { 111 - txbuf = kmalloc(len, GFP_KERNEL); 111 + txbuf = kmemdup(tx, len, GFP_KERNEL); 112 112 if (!txbuf) { 113 113 ret = -ENOMEM; 114 114 goto out_free; 115 115 } 116 - memcpy(txbuf, tx, len); 117 116 } 118 117 119 118 if (rx) {