Skip to content

Commit

Permalink
ALSA: hdsp: silence and underflow warning
Browse files Browse the repository at this point in the history
I believe this probably cannot happen, as the code suggests.  There
would have to be an kcontrol->index.id which was zero, otherwise this
would be prevented in snd_ctl_find_id().  But snd_BUG_ON() is just a
WARN() or a no-op so static checkers complain that we keep on going with
a negative offset.  Let's just handle the error as well as printing
a warning.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Dan Carpenter authored and tiwai committed Aug 21, 2015
1 parent 18dfd79 commit 9e46aed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/pci/rme9652/hdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,8 @@ static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct sn
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);

offset = ucontrol->id.index - 1;
snd_BUG_ON(offset < 0);
if (snd_BUG_ON(offset < 0))
return -EINVAL;

switch (hdsp->io_type) {
case Digiface:
Expand Down

0 comments on commit 9e46aed

Please sign in to comment.