linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ALSA: line6: Use kmemdup in podhd_set_monitor_level()
@ 2020-07-17  8:17 YueHaibing
  2020-07-17  8:58 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-07-17  8:17 UTC (permalink / raw)
  To: perex, tiwai, anarsoul; +Cc: alsa-devel, linux-kernel, YueHaibing

Use kmemdup rather than duplicating its implementation.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 sound/usb/line6/podhd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c
index 1557483ec657..eef45f7fef0d 100644
--- a/sound/usb/line6/podhd.c
+++ b/sound/usb/line6/podhd.c
@@ -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;
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] ALSA: line6: Use kmemdup in podhd_set_monitor_level()
  2020-07-17  8:17 [PATCH -next] ALSA: line6: Use kmemdup in podhd_set_monitor_level() YueHaibing
@ 2020-07-17  8:58 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-07-17  8:58 UTC (permalink / raw)
  To: YueHaibing; +Cc: perex, tiwai, anarsoul, alsa-devel, linux-kernel

On Fri, 17 Jul 2020 10:17:10 +0200,
YueHaibing wrote:
> 
> Use kmemdup rather than duplicating its implementation.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-17  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  8:17 [PATCH -next] ALSA: line6: Use kmemdup in podhd_set_monitor_level() YueHaibing
2020-07-17  8:58 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).