diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-11-29 07:00:33 +0100 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2018-12-04 15:57:42 +0100 |
commit | 5ff75c489ce0466744684f5a549dd79f4ba697ca (patch) | |
tree | 420ccdf777ecd199f0bb685fb75eb0bde251e5d4 /drivers/gpu/drm/tinydrm | |
parent | drm/vkms: Remove set but not used variable 'vkms_obj' (diff) | |
download | linux-5ff75c489ce0466744684f5a549dd79f4ba697ca.tar.xz linux-5ff75c489ce0466744684f5a549dd79f4ba697ca.zip |
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
Diffstat (limited to 'drivers/gpu/drm/tinydrm')
-rw-r--r-- | drivers/gpu/drm/tinydrm/repaper.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 07f45a008a0f..54d6fe0f37ce 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c @@ -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) { |