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>
This commit is contained in:
YueHaibing 2020-07-17 16:17:10 +08:00 committed by Takashi Iwai
parent 61eee4a7fc
commit 71ea8eebdd

View File

@ -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;