sound: control: fix minimum TLV length

Allow TLV blocks that do not have any values; the smallest possible TLV
is an empty container or one where the information is only in the tag.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Clemens Ladisch 2010-02-01 13:30:56 +01:00 committed by Jaroslav Kysela
parent a75d7a4cf5
commit 6123637faf

View File

@ -1100,7 +1100,7 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,
if (copy_from_user(&tlv, _tlv, sizeof(tlv))) if (copy_from_user(&tlv, _tlv, sizeof(tlv)))
return -EFAULT; return -EFAULT;
if (tlv.length < sizeof(unsigned int) * 3) if (tlv.length < sizeof(unsigned int) * 2)
return -EINVAL; return -EINVAL;
down_read(&card->controls_rwsem); down_read(&card->controls_rwsem);
kctl = snd_ctl_find_numid(card, tlv.numid); kctl = snd_ctl_find_numid(card, tlv.numid);