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

Commit 9badda0a authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref()



Dan Carpenter reported that setting 0 to uinfo->value.enumerated.items
in snd_hdsp_info_pref_sync_ref() may lead to Oops.  This function should
return an error immediately in such a case instead.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 80c8a2a3
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2640,8 +2640,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
		uinfo->value.enumerated.items = 3;
		break;
	default:
		uinfo->value.enumerated.items = 0;
		break;
		return -EINVAL;
	}

	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)