projects
/
openwrt
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ar71xx/ag71xx_ar7240_get_port_link: fix off-by-one check on argument `port`
[openwrt/openwrt.git]
/
target
/
linux
/
ar71xx
/
files
/
drivers
/
net
/
ethernet
/
atheros
/
ag71xx
/
ag71xx_ar7240.c
diff --git
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
index c5aed0d2dbfcc726f54ca7eaf7dde2f7aba03ca7..e457acb50cf03e2ece5584843d6ce437da8bb8cb 100644
(file)
--- a/
target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
+++ b/
target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
@@
-963,7
+963,7
@@
ar7240_get_port_link(struct switch_dev *dev, int port,
struct mii_bus *mii = as->mii_bus;
u32 status;
struct mii_bus *mii = as->mii_bus;
u32 status;
- if (port > AR7240_NUM_PORTS)
+ if (port >
=
AR7240_NUM_PORTS)
return -EINVAL;
status = ar7240sw_reg_read(mii, AR7240_REG_PORT_STATUS(port));
return -EINVAL;
status = ar7240sw_reg_read(mii, AR7240_REG_PORT_STATUS(port));
@@
-1000,7
+1000,7
@@
ar7240_get_port_stats(struct switch_dev *dev, int port,
{
struct ar7240sw *as = sw_to_ar7240(dev);
{
struct ar7240sw *as = sw_to_ar7240(dev);
- if (port > AR7240_NUM_PORTS)
+ if (port >
=
AR7240_NUM_PORTS)
return -EINVAL;
ar7240sw_capture_stats(as);
return -EINVAL;
ar7240sw_capture_stats(as);