From ce3c177ff8fb64f73bbca6123b81ae3e8ee49905 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 3 May 2012 05:52:39 +0000 Subject: [PATCH] Fix a totally bone-headed, last minute bounds check snafu that somehow I must've missed when booting a test kernel. This has been validated on the AR7161. --- sys/mips/atheros/ar71xx_chip.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/mips/atheros/ar71xx_chip.c b/sys/mips/atheros/ar71xx_chip.c index 0b083ccac80..2a257166c44 100644 --- a/sys/mips/atheros/ar71xx_chip.c +++ b/sys/mips/atheros/ar71xx_chip.c @@ -192,21 +192,23 @@ ar71xx_chip_set_mii_if(uint32_t unit, uint32_t mii_mode) mii_if = MII0_CTRL_IF_RGMII; else if (mii_mode == AR71XX_MII_MODE_RMII) mii_if = MII0_CTRL_IF_RMII; - else + else { printf("%s: invalid MII mode (%d) for unit %d\n", __func__, mii_mode, unit); return; + } break; case 1: reg = AR71XX_MII1_CTRL; if (mii_mode == AR71XX_MII_MODE_RGMII) mii_if = MII1_CTRL_IF_RGMII; - if (mii_mode == AR71XX_MII_MODE_RMII) + else if (mii_mode == AR71XX_MII_MODE_RMII) mii_if = MII1_CTRL_IF_RMII; - else + else { printf("%s: invalid MII mode (%d) for unit %d\n", __func__, mii_mode, unit); return; + } break; default: printf("%s: invalid MII unit set for arge unit: %d\n",