Skip to content

Commit

Permalink
drm/tinydrm: Use kmemdup rather than duplicating its implementation i…
Browse files Browse the repository at this point in the history
…n repaper_spi_transfer()

use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
YueHaibing authored and notro committed Dec 4, 2018
1 parent 77e9c35 commit 5ff75c4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/tinydrm/repaper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5ff75c4

Please sign in to comment.