From: Takashi Iwai Date: Mon, 9 Jan 2012 17:22:35 +0000 (+0100) Subject: ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref() X-Git-Tag: upstream/snapshot3+hdmi~7307^2~117^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9badda0a0afffebbe1cb30565800896534a6c5bd;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 0111203..b68cdec 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 uinfo->value.enumerated.items = 3; break; default: - uinfo->value.enumerated.items = 0; - break; + return -EINVAL; } if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)