projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e4a718
)
ALSA: info - Use krealloc()
author
Takashi Iwai
<tiwai@suse.de>
Mon, 6 Jul 2009 12:31:59 +0000
(14:31 +0200)
committer
Takashi Iwai
<tiwai@suse.de>
Mon, 6 Jul 2009 12:31:59 +0000
(14:31 +0200)
Use krealloc() to resize the buffer in sound/core/info.c.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/info.c
patch
|
blob
|
history
diff --git
a/sound/core/info.c
b/sound/core/info.c
index 35df614f6c5599329a403beb7295f3ffe3a51d2e..3d1f5137420a4eca7c15c16cdb40f5fe52686d8e 100644
(file)
--- a/
sound/core/info.c
+++ b/
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 = k
malloc(
nsize, GFP_KERNEL);
+ nbuf = k
realloc(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;