Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9983aa62 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: info - Use krealloc()



Use krealloc() to resize the buffer in sound/core/info.c.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8e4a718f
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -88,12 +88,10 @@ static int resize_info_buffer(struct snd_info_buffer *buffer,
	char *nbuf;
	char *nbuf;


	nsize = PAGE_ALIGN(nsize);
	nsize = PAGE_ALIGN(nsize);
	nbuf = kmalloc(nsize, GFP_KERNEL);
	nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL);
	if (! nbuf)
	if (! nbuf)
		return -ENOMEM;
		return -ENOMEM;


	memcpy(nbuf, buffer->buffer, buffer->len);
	kfree(buffer->buffer);
	buffer->buffer = nbuf;
	buffer->buffer = nbuf;
	buffer->len = nsize;
	buffer->len = nsize;
	return 0;
	return 0;