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

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.com


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 61eee4a7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;