Skip to content

Commit

Permalink
ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed Jan 9, 2012
1 parent 80c8a2a commit 9badda0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/pci/rme9652/hdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9badda0

Please sign in to comment.