lkml.org 
[lkml]   [2020]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] ALSA: line6: Use kmemdup in podhd_set_monitor_level()
Date
Use kmemdup rather than duplicating its implementation.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
sound/usb/line6/podhd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c
index 1557483ec657..eef45f7fef0d 100644
--- a/sound/usb/line6/podhd.c
+++ b/sound/usb/line6/podhd.c
@@ -293,12 +293,10 @@ static void podhd_set_monitor_level(struct usb_line6_podhd *podhd, int value)
};
unsigned char *buf;

- buf = kmalloc(sizeof(msg), GFP_KERNEL);
+ buf = kmemdup(msg, sizeof(msg), GFP_KERNEL);
if (!buf)
return;

- memcpy(buf, msg, sizeof(msg));
-
if (value < 0)
value = 0;

--
2.17.1

\
 
 \ /
  Last update: 2020-07-17 10:18    [W:0.142 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site