aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_edsa.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-01-27 15:29:37 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-29 18:42:46 -0500
commit26895e299cfb583d304553e9c259e694a7e83397 (patch)
tree84efe62291aa646b75bb4778db06644e2062fb74 /net/dsa/tag_edsa.c
parentnet: dsa: variable number of ports (diff)
downloadlinux-dev-26895e299cfb583d304553e9c259e694a7e83397.tar.xz
linux-dev-26895e299cfb583d304553e9c259e694a7e83397.zip
net: dsa: use ds->num_ports when possible
The dsa_switch structure contains the number of ports. Use it where the structure is valid instead of the DSA_MAX_PORTS value. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_edsa.c')
-rw-r--r--net/dsa/tag_edsa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index 6c1720e88537..929de581a846 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -127,7 +127,7 @@ static int edsa_rcv(struct sk_buff *skb, struct net_device *dev,
if (!ds)
goto out_drop;
- if (source_port >= DSA_MAX_PORTS || !ds->ports[source_port].netdev)
+ if (source_port >= ds->num_ports || !ds->ports[source_port].netdev)
goto out_drop;
/*