Also add a WARN_ON to 'ar8216_mib_fetch_port_stat'
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 34283
+ WARN_ON(port >= priv->dev.ports);
+
lockdep_assert_held(&priv->mib_lock);
if (chip_is_ar8327(priv))
lockdep_assert_held(&priv->mib_lock);
if (chip_is_ar8327(priv))
next_port:
priv->mib_next_port++;
next_port:
priv->mib_next_port++;
- if (priv->mib_next_port > priv->dev.ports)
+ if (priv->mib_next_port >= priv->dev.ports)
priv->mib_next_port = 0;
mutex_unlock(&priv->mib_lock);
priv->mib_next_port = 0;
mutex_unlock(&priv->mib_lock);