[dpdk-dev] net/bonding: validate bonded port id before access its data
Checks
Commit Message
Fixes: 4c42498d916d ("net/bonding: allow slaves to also be bonded devices")
Signed-off-by: Herbert Guan <herbert.guan@arm.com>
---
drivers/net/bonding/rte_eth_bond_api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 7/31/2017 4:24 AM, Herbert Guan wrote:
> Fixes: 4c42498d916d ("net/bonding: allow slaves to also be bonded devices")
>
> Signed-off-by: Herbert Guan <herbert.guan@arm.com>
Thanks for the patch, this looks like duplicate [1], I will get the
other one since it has been sent earlier.
[1]
http://dpdk.org/dev/patchwork/patch/27225/
Thanks,
ferruh
@@ -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;