projects
/
openwrt
/
staging
/
yousong.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
258b2f2
)
generic: ar8216: fix port number check in 'ar8xxx_mib_work_func'
author
Gabor Juhos
<
[email protected]
>
Tue, 20 Nov 2012 20:40:04 +0000
(20:40 +0000)
committer
Gabor Juhos
<
[email protected]
>
Tue, 20 Nov 2012 20:40:04 +0000
(20:40 +0000)
Also add a WARN_ON to 'ar8216_mib_fetch_port_stat'
Signed-off-by: Gabor Juhos <
[email protected]
>
SVN-Revision: 34283
target/linux/generic/files/drivers/net/phy/ar8216.c
patch
|
blob
|
history
diff --git
a/target/linux/generic/files/drivers/net/phy/ar8216.c
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 8fc1f4b37e62b212294665e7f6c40e9bffbae3ec..6187d523ab61efe1cd875683e80dedca9a7de4bc 100644
(file)
--- a/
target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/
target/linux/generic/files/drivers/net/phy/ar8216.c
@@
-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);