From 7ed0831923db7da247fd6bc2ee309eeec3f74d0a Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 5 Feb 2018 05:51:37 +0000 Subject: [PATCH] [arswitch] Break out of the loop upon any error, not just -1. This fixes the AR9340 "unimplemented" thingy for now. --- sys/dev/etherswitch/arswitch/arswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index 27d8fb06974..d582c097c55 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -1187,7 +1187,7 @@ arswitch_atu_fetch_table(device_t dev, etherswitch_atu_table_t *table) err = sc->hal.arswitch_atu_fetch_table(sc, NULL, 0); /* fetch - ideally yes we'd fetch into a separate table then switch */ - while (err != -1 && nitems < sc->atu.size) { + while (err == 0 && nitems < sc->atu.size) { err = sc->hal.arswitch_atu_fetch_table(sc, &sc->atu.entries[nitems], 1); if (err == 0) {