mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 10:01:25 +00:00
Merge branch 'topic/cleanup' into for-linus
* topic/cleanup: ALSA: info - Use krealloc()
This commit is contained in:
commit
d0064a1b22
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue