=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/dev.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- src/usr.bin/sndiod/dev.c 2021/03/08 09:42:50 1.97 +++ src/usr.bin/sndiod/dev.c 2021/03/10 08:21:27 1.98 @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.97 2021/03/08 09:42:50 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.98 2021/03/10 08:21:27 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -1777,23 +1777,23 @@ bestidx = i; } } - if (bestidx != DEV_NSLOT) { - s = slot_array + bestidx; - s->vol = MIDI_MAXCTL; - strlcpy(s->name, name, SLOT_NAMEMAX); - s->serial = slot_serial++; - for (i = 0; unit[i] != NULL; i++) - ; /* nothing */ - s->unit = i; - s->id = id; - goto found; - } - if (log_level >= 1) { - log_puts(name); - log_puts(": out of sub-device slots\n"); + if (bestidx == DEV_NSLOT) { + if (log_level >= 1) { + log_puts(name); + log_puts(": out of sub-device slots\n"); + } + return NULL; } - return NULL; + + s = slot_array + bestidx; + s->vol = MIDI_MAXCTL; + strlcpy(s->name, name, SLOT_NAMEMAX); + s->serial = slot_serial++; + for (i = 0; unit[i] != NULL; i++) + ; /* nothing */ + s->unit = i; + s->id = id; found: if ((mode & MODE_REC) && (opt->mode & MODE_MON)) {