From 9983aa62c321a22774e47cf701b6d8b16d92a822 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 6 Jul 2009 14:31:59 +0200 Subject: ALSA: info - Use krealloc() Use krealloc() to resize the buffer in sound/core/info.c. Signed-off-by: Takashi Iwai --- sound/core/info.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sound/core/info.c') diff --git a/sound/core/info.c b/sound/core/info.c index 35df614f6c5..3d1f5137420 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -88,12 +88,10 @@ static int resize_info_buffer(struct snd_info_buffer *buffer, char *nbuf; nsize = PAGE_ALIGN(nsize); - nbuf = kmalloc(nsize, GFP_KERNEL); + nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL); if (! nbuf) return -ENOMEM; - memcpy(nbuf, buffer->buffer, buffer->len); - kfree(buffer->buffer); buffer->buffer = nbuf; buffer->len = nsize; return 0; -- cgit v1.2.3-70-g09d2