Merge branch 'topic/cleanup' into for-linus
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Sep 2009 13:32:43 +0000 (15:32 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Sep 2009 13:32:43 +0000 (15:32 +0200)
* topic/cleanup:
  ALSA: info - Use krealloc()

sound/core/info.c

index 35df614..3d1f513 100644 (file)
@@ -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;