Skip to content

Commit 71ea8ee

Browse files
YueHaibingtiwai
authored andcommitted
ALSA: line6: Use kmemdup in podhd_set_monitor_level()
Use kmemdup rather than duplicating its implementation. Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 61eee4a commit 71ea8ee

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sound/usb/line6/podhd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,10 @@ static void podhd_set_monitor_level(struct usb_line6_podhd *podhd, int value)
293293
};
294294
unsigned char *buf;
295295

296-
buf = kmalloc(sizeof(msg), GFP_KERNEL);
296+
buf = kmemdup(msg, sizeof(msg), GFP_KERNEL);
297297
if (!buf)
298298
return;
299299

300-
memcpy(buf, msg, sizeof(msg));
301-
302300
if (value < 0)
303301
value = 0;
304302

0 commit comments

Comments
 (0)