Skip to contentSkip to conversation

ALSA: line6: Use kmemdup in podhd_set_monitor_level()

PATCH In review YueHaibing 2 participants 2 messages Jul 17, 2020 Sound

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 ALSA: line6: Use kmemdup in podhd_set_monitor_level()

Use kmemdup rather than duplicating its implementation.

---
 sound/usb/line6/podhd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/usb/line6/podhd.c +1 -3
index 1557483ec657..eef45f7fef0d 100644
@@ -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;
 
Signature · 1 line
2.17.1