projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11b1f82
)
dsa: do not dereference non-existing routing table
author
Tobias Waldekranz
<tobias@waldekranz.com>
Thu, 5 Feb 2015 13:52:06 +0000
(14:52 +0100)
committer
David S. Miller
<davem@davemloft.net>
Sun, 8 Feb 2015 06:07:36 +0000
(22:07 -0800)
In the case where there is only one switch, no routing table will have
been allocated, so do not dereference it in this case.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6131.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/dsa/mv88e6131.c
b/drivers/net/dsa/mv88e6131.c
index 1230f52aa70e8c4d31e8be1d397f59eab9c4b7eb..2540ef0142afd68f5dfb489850bbd9ad64f3fdc2 100644
(file)
--- a/
drivers/net/dsa/mv88e6131.c
+++ b/
drivers/net/dsa/mv88e6131.c
@@
-139,7
+139,8
@@
static int mv88e6131_setup_global(struct dsa_switch *ds)
int nexthop;
nexthop = 0x1f;
- if (i != ds->index && i < ds->dst->pd->nr_chips)
+ if (ds->pd->rtable &&
+ i != ds->index && i < ds->dst->pd->nr_chips)
nexthop = ds->pd->rtable[i] & 0x1f;
REG_WRITE(REG_GLOBAL2, 0x06, 0x8000 | (i << 8) | nexthop);