* [PATCH -next] drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer()
@ 2018-11-29 6:00 YueHaibing
2018-12-04 15:00 ` Noralf Trønnes
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-11-29 6:00 UTC (permalink / raw)
To: noralf, airlied; +Cc: YueHaibing, dri-devel, linux-kernel, kernel-janitors
use kmemdup rather than duplicating its implementation
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/gpu/drm/tinydrm/repaper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c
index 07f45a0..54d6fe0 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) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer()
2018-11-29 6:00 [PATCH -next] drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer() YueHaibing
@ 2018-12-04 15:00 ` Noralf Trønnes
0 siblings, 0 replies; 2+ messages in thread
From: Noralf Trønnes @ 2018-12-04 15:00 UTC (permalink / raw)
To: YueHaibing, airlied; +Cc: dri-devel, linux-kernel, kernel-janitors
Den 29.11.2018 07.00, skrev YueHaibing:
> use kmemdup rather than duplicating its implementation
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
Thanks, applied to drm-misc-next.
Noralf.
> drivers/gpu/drm/tinydrm/repaper.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c
> index 07f45a0..54d6fe0 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) {
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-04 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 6:00 [PATCH -next] drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer() YueHaibing
2018-12-04 15:00 ` Noralf Trønnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).