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:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user