Skip to content

Commit

Permalink
ALSA: info - Use krealloc()
Browse files Browse the repository at this point in the history
Use krealloc() to resize the buffer in sound/core/info.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jul 6, 2009
1 parent 8e4a718 commit 9983aa6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/core/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9983aa6

Please sign in to comment.