Skip to content

Commit

Permalink
sound: control: fix minimum TLV length
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clemens Ladisch authored and Jaroslav Kysela committed Feb 1, 2010
1 parent a75d7a4 commit 6123637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,

if (copy_from_user(&tlv, _tlv, sizeof(tlv)))
return -EFAULT;
if (tlv.length < sizeof(unsigned int) * 3)
if (tlv.length < sizeof(unsigned int) * 2)
return -EINVAL;
down_read(&card->controls_rwsem);
kctl = snd_ctl_find_numid(card, tlv.numid);
Expand Down

0 comments on commit 6123637

Please sign in to comment.