projects
/
openwrt
/
staging
/
neocturne.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08db3e1
)
generic: ar8216: fix invalid bounds check imported from ChromeOS (FS#347)
author
Jo-Philipp Wich
<jo@mein.io>
Fri, 23 Dec 2016 18:15:14 +0000
(19:15 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Fri, 23 Dec 2016 18:24:14 +0000
(19:24 +0100)
The priv->vlan_id member is of size AR8X16_MAX_VLANS, not AR8X16_MAX_PORTS,
so check for the proper maximum value in order to avoid capping valid VLAN IDs
to 7 (AR8X16_MAX_PORTS - 1).
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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 746d8e6c3dcc312b03f851901b0c4d9ec8edfa96..27b062bc478bc1429ede386cb7ecb2b8a037bb03 100644
(file)
--- a/
target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/
target/linux/generic/files/drivers/net/phy/ar8216.c
@@
-975,7
+975,7
@@
ar8xxx_sw_set_vid(struct switch_dev *dev, const struct switch_attr *attr,
{
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
- if (val->port_vlan >= AR8X16_MAX_
PORT
S)
+ if (val->port_vlan >= AR8X16_MAX_
VLAN
S)
return -EINVAL;
priv->vlan_id[val->port_vlan] = val->value.i;