Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6123637f authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela
Browse files

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: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent a75d7a4c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);