Thread (2 messages) 2 messages, 2 authors, 2017-07-31
STALE3282d

[PATCH] net/bonding: validate bonded port id before access its data

From: Herbert Guan <hidden>
Date: 2017-07-31 03:24:57
Subsystem: bonding driver, networking drivers, the rest · Maintainers: Jay Vosburgh, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Fixes: 4c42498d916d ("net/bonding: allow slaves to also be bonded devices")

Signed-off-by: Herbert Guan <redacted>
---
 drivers/net/bonding/rte_eth_bond_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 824ab4f..6039500 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -514,11 +514,11 @@
 {
 	struct bond_dev_private *internals;
 
-	internals =  rte_eth_devices[bonded_port_id].data->dev_private;
-
 	if (valid_bonded_port_id(bonded_port_id) != 0)
 		return -1;
 
+	internals =  rte_eth_devices[bonded_port_id].data->dev_private;
+
 	if (valid_slave_port_id(slave_port_id, internals->mode) != 0)
 		return -1;
 
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help