diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-01-09 12:22:35 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-09 12:27:44 -0500 |
commit | 9badda0a0afffebbe1cb30565800896534a6c5bd (patch) | |
tree | 2b004e66d252420b68ce68f86c07444576c6dc7b /sound/pci/rme9652 | |
parent | 80c8a2a372599e604b04a9c568952fe39cd1851d (diff) |
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>
Diffstat (limited to 'sound/pci/rme9652')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 0111203859b6..b68cdec03b9e 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -2640,8 +2640,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd | |||
2640 | uinfo->value.enumerated.items = 3; | 2640 | uinfo->value.enumerated.items = 3; |
2641 | break; | 2641 | break; |
2642 | default: | 2642 | default: |
2643 | uinfo->value.enumerated.items = 0; | 2643 | return -EINVAL; |
2644 | break; | ||
2645 | } | 2644 | } |
2646 | 2645 | ||
2647 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | 2646 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |