Commit 71ea8eeb authored by YueHaibing's avatar YueHaibing Committed by Takashi Iwai

ALSA: line6: Use kmemdup in podhd_set_monitor_level()

Use kmemdup rather than duplicating its implementation.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200717081710.39180-1-yuehaibing@huawei.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 61eee4a7
...@@ -293,12 +293,10 @@ static void podhd_set_monitor_level(struct usb_line6_podhd *podhd, int value) ...@@ -293,12 +293,10 @@ static void podhd_set_monitor_level(struct usb_line6_podhd *podhd, int value)
}; };
unsigned char *buf; unsigned char *buf;
buf = kmalloc(sizeof(msg), GFP_KERNEL); buf = kmemdup(msg, sizeof(msg), GFP_KERNEL);
if (!buf) if (!buf)
return; return;
memcpy(buf, msg, sizeof(msg));
if (value < 0) if (value < 0)
value = 0; value = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment