[ALSA] emu10k1 - Fix over-sized kmalloc for TLV

Reported by Al Viro:
In copy_tlv(), the size of kmalloc is wrongly calculated.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Takashi Iwai 2008-01-19 10:33:07 +01:00 committed by Jaroslav Kysela
parent 28a0d9df07
commit 6735e5723b
1 changed files with 1 additions and 1 deletions

View File

@ -665,7 +665,7 @@ static unsigned int *copy_tlv(const unsigned int __user *_tlv)
return NULL;
if (data[1] >= MAX_TLV_SIZE)
return NULL;
tlv = kmalloc(data[1] * 4 + sizeof(data), GFP_KERNEL);
tlv = kmalloc(data[1] + sizeof(data), GFP_KERNEL);
if (!tlv)
return NULL;
memcpy(tlv, data, sizeof(data));