Ver código fonte

Merge branch 'topic/cleanup' into for-linus

* topic/cleanup:
  ALSA: info - Use krealloc()
Takashi Iwai 15 anos atrás
pai
commit
d0064a1b22
1 arquivos alterados com 1 adições e 3 exclusões
  1. 1 3
      sound/core/info.c

+ 1 - 3
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;