Commit 9e46aeda authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai

ALSA: hdsp: silence and underflow warning

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 18dfd79d
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment