mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
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:
parent
61eee4a7fc
commit
71ea8eebdd
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user