Commit 6735e572 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 28a0d9df
...@@ -665,7 +665,7 @@ static unsigned int *copy_tlv(const unsigned int __user *_tlv) ...@@ -665,7 +665,7 @@ static unsigned int *copy_tlv(const unsigned int __user *_tlv)
return NULL; return NULL;
if (data[1] >= MAX_TLV_SIZE) if (data[1] >= MAX_TLV_SIZE)
return NULL; return NULL;
tlv = kmalloc(data[1] * 4 + sizeof(data), GFP_KERNEL); tlv = kmalloc(data[1] + sizeof(data), GFP_KERNEL);
if (!tlv) if (!tlv)
return NULL; return NULL;
memcpy(tlv, data, sizeof(data)); memcpy(tlv, data, sizeof(data));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment