From: Jaroslav Kysela Date: Fri, 1 Oct 2010 12:08:03 +0000 (+0200) Subject: namehint: Another fix to properly evaluate hw devices X-Git-Tag: v1.0.24~21 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=c049d48407ff0459ff15e466edeeee6ecff67fcd;p=alsa-lib.git namehint: Another fix to properly evaluate hw devices Signed-off-by: Jaroslav Kysela --- diff --git a/src/control/namehint.c b/src/control/namehint.c index ab3525eb..faaa5d51 100644 --- a/src/control/namehint.c +++ b/src/control/namehint.c @@ -439,11 +439,12 @@ static int add_card(struct hint_list *list, int card) err = next_devices[list->iface](list->ctl, &device); if (device < 0) err = -EINVAL; + else + max_device = device; while (err >= 0 && device >= 0) { err = next_devices[list->iface](list->ctl, &device); - if (device > max_device) + if (err >= 0 && device > max_device) max_device = device; - ok++; } ok = 0; for (device = 0; err >= 0 && device <= max_device; device++) {