ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0
[pandora-kernel.git] / sound / core / control.c
index 1ba5d33..96c62e5 100644 (file)
@@ -1321,6 +1321,8 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,
                return -EFAULT;
        if (tlv.length < sizeof(unsigned int) * 2)
                return -EINVAL;
+       if (!tlv.numid)
+               return -EINVAL;
        down_read(&card->controls_rwsem);
        kctl = snd_ctl_find_numid(card, tlv.numid);
        if (kctl == NULL) {