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

Commit 2a031aed authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Takashi Iwai
Browse files

sound: snd_ctl_elem_add: fix value count check



Make sure that no user element that has no values can be added.

The check for count>1024 is not needed because the count is checked
later for the individual control types.

Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 64f1607f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -951,7 +951,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
	
	if (card->user_ctl_count >= MAX_USER_CONTROLS)
		return -ENOMEM;
	if (info->count > 1024)
	if (info->count < 1)
		return -EINVAL;
	access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
		(info->access & (SNDRV_CTL_ELEM_ACCESS_READWRITE|