Author: adrian
Date: Thu May  3 05:52:39 2012
New Revision: 234941
URL: http://svn.freebsd.org/changeset/base/234941

Log:
  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.

Modified:
  head/sys/mips/atheros/ar71xx_chip.c

Modified: head/sys/mips/atheros/ar71xx_chip.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_chip.c Thu May  3 05:32:56 2012        
(r234940)
+++ head/sys/mips/atheros/ar71xx_chip.c Thu May  3 05:52:39 2012        
(r234941)
@@ -192,21 +192,23 @@ ar71xx_chip_set_mii_if(uint32_t unit, ui
                        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",
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to