mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-02 01:27:53 +07:00
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: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
80c8a2a372
commit
9badda0a0a
@ -2640,8 +2640,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
|
|||||||
uinfo->value.enumerated.items = 3;
|
uinfo->value.enumerated.items = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
uinfo->value.enumerated.items = 0;
|
return -EINVAL;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
|
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
|
||||||
|
Loading…
Reference in New Issue
Block a user