aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-03-13 07:01:13 -0400
committerTakashi Iwai <tiwai@suse.de>2013-03-13 07:03:33 -0400
commit0d861ac23812428deae17de2038234b79818b964 (patch)
tree3efc88ae02fa65bdf001a13f8e454e107aed7820 /sound/core
parenteb7c06e8e9c93b495e355421cffd3c43c266d7d2 (diff)
ALSA: info: Avoid leaking kernel memory
Make sure that the allocated buffer for reading the proc file won't expose the uncleared kernel memory. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index db308dbc8911..58e97b35cceb 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -89,7 +89,7 @@ static int resize_info_buffer(struct snd_info_buffer *buffer,
89 char *nbuf; 89 char *nbuf;
90 90
91 nsize = PAGE_ALIGN(nsize); 91 nsize = PAGE_ALIGN(nsize);
92 nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL); 92 nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL | __GFP_ZERO);
93 if (! nbuf) 93 if (! nbuf)
94 return -ENOMEM; 94 return -ENOMEM;
95 95
@@ -353,7 +353,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
353 goto __nomem; 353 goto __nomem;
354 data->rbuffer = buffer; 354 data->rbuffer = buffer;
355 buffer->len = PAGE_SIZE; 355 buffer->len = PAGE_SIZE;
356 buffer->buffer = kmalloc(buffer->len, GFP_KERNEL); 356 buffer->buffer = kzalloc(buffer->len, GFP_KERNEL);
357 if (buffer->buffer == NULL) 357 if (buffer->buffer == NULL)
358 goto __nomem; 358 goto __nomem;
359 } 359 }