aboutsummaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorYueHaibing2020-07-17 16:17:10 +0800
committerTakashi Iwai2020-07-17 10:57:44 +0200
commit71ea8eebdd4455a43a78b68fd2d106719735c211 (patch)
tree23e25c905c6022188fd52aad34cd347b7aeb463c /sound/usb
parent61eee4a7fc406f94e441778c3cecbbed30373c89 (diff)
ALSA: line6: Use kmemdup in podhd_set_monitor_level()
Use kmemdup rather than duplicating its implementation. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20200717081710.39180-1-yuehaibing@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/line6/podhd.c4
1 files changed, 1 insertions, 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;