diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-03-13 12:01:13 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-03-13 12:03:33 +0100 |
commit | 0d861ac23812428deae17de2038234b79818b964 (patch) | |
tree | 3efc88ae02fa65bdf001a13f8e454e107aed7820 | |
parent | eb7c06e8e9c93b495e355421cffd3c43c266d7d2 (diff) | |
download | op-kernel-dev-0d861ac23812428deae17de2038234b79818b964.zip op-kernel-dev-0d861ac23812428deae17de2038234b79818b964.tar.gz |
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>
-rw-r--r-- | sound/core/info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/info.c b/sound/core/info.c index db308db..58e97b3 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, char *nbuf; nsize = PAGE_ALIGN(nsize); - nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL); + nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL | __GFP_ZERO); if (! nbuf) return -ENOMEM; @@ -353,7 +353,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file) goto __nomem; data->rbuffer = buffer; buffer->len = PAGE_SIZE; - buffer->buffer = kmalloc(buffer->len, GFP_KERNEL); + buffer->buffer = kzalloc(buffer->len, GFP_KERNEL); if (buffer->buffer == NULL) goto __nomem; } |