projects
/
deliverable
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c217429
)
ALSA: hda - Add max allocation check in array allocator
author
Takashi Iwai
<tiwai@suse.de>
Thu, 6 Nov 2008 23:26:52 +0000
(
00:26
+0100)
committer
Takashi Iwai
<tiwai@suse.de>
Thu, 6 Nov 2008 23:26:52 +0000
(
00:26
+0100)
Added a check for max allocation size in snd_array_new() for a
debugging purpose.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/pci/hda/hda_codec.c
b/sound/pci/hda/hda_codec.c
index f13834ba6b1d6fca3d13a6bca0e39bcafffb8b1f..6f170b281e85dd90799602671863c65cfaafa447 100644
(file)
--- a/
sound/pci/hda/hda_codec.c
+++ b/
sound/pci/hda/hda_codec.c
@@
-3399,7
+3399,10
@@
void *snd_array_new(struct snd_array *array)
{
if (array->used >= array->alloced) {
int num = array->alloced + array->alloc_align;
- void *nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL);
+ void *nlist;
+ if (snd_BUG_ON(num >= 4096))
+ return NULL;
+ nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL);
if (!nlist)
return NULL;
if (array->list) {
This page took
0.027145 seconds
and
5
git commands to generate.