1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 19:03:08 +02:00

generic: ar8216: fix port number check in 'ar8xxx_mib_work_func'

Also add a WARN_ON to 'ar8216_mib_fetch_port_stat'

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34283 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2012-11-20 20:40:04 +00:00
parent e0cb5a2b6c
commit 62d84c033a

View File

@ -425,6 +425,8 @@ ar8216_mib_fetch_port_stat(struct ar8216_priv *priv, int port, bool flush)
u64 *mib_stats;
int i;
WARN_ON(port >= priv->dev.ports);
lockdep_assert_held(&priv->mib_lock);
if (chip_is_ar8327(priv))
@ -1710,7 +1712,7 @@ ar8xxx_mib_work_func(struct work_struct *work)
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);