=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/dev.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- src/usr.bin/sndiod/dev.c 2021/03/03 10:19:06 1.94 +++ src/usr.bin/sndiod/dev.c 2021/03/08 09:35:08 1.95 @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.94 2021/03/03 10:19:06 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.95 2021/03/08 09:35:08 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -1150,7 +1150,7 @@ } d->slot_list = NULL; - for (c = ctlslot_array, i = DEV_NCTLSLOT; i > 0; i--, c++) { + for (c = ctlslot_array, i = 0; i < DEV_NCTLSLOT; i++, c++) { if (c->ops == NULL) continue; if (c->opt->dev != d) @@ -2581,8 +2581,10 @@ NULL, -1, 127, d->master); } - for (s = ctlslot_array, i = DEV_NCTLSLOT; i > 0; i--, s++) { - if (s->ops && s->opt->dev == d) + for (s = ctlslot_array, i = 0; i < DEV_NCTLSLOT; i++, s++) { + if (s->ops == NULL) + continue; + if (s->opt->dev == d) s->ops->sync(s->arg); } }