[dpdk-stable] [dpdk-dev] [PATCH] net/bonding: fix segfault using invalid port
Ye Xiaolong
xiaolong.ye at intel.com
Tue Oct 29 04:04:06 CET 2019
On 10/28, Yang, Qiming wrote:
>Hi, Junyu
>
>> + dev = &rte_eth_devices[port];
>> + internals = dev->data->dev_private;
>Have you build success? I think we need to add (struct bond_dev_private *) for force transfer
dev_private is a void *, an explicit type conversion is not needed here.
Thanks,
Xiaolong
>
>>
>> if (check_for_bonded_ethdev(dev) != 0)
>> return -1;
>> @@ -1689,9 +1696,14 @@ int
>> rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) {
>> int retval = 0;
>> - struct rte_eth_dev *dev = &rte_eth_devices[port];
>> - struct bond_dev_private *internals = (struct bond_dev_private *)
>> - dev->data->dev_private;
>> + struct rte_eth_dev *dev;
>> + struct bond_dev_private *internals;
>> +
>> + if (valid_bonded_port_id(port) != 0)
>> + return -EINVAL;
>> +
>> + dev = &rte_eth_devices[port];
>> + internals = dev->data->dev_private;
>Same as before
>
>>
>> if (check_for_bonded_ethdev(dev) != 0)
>> return -1;
>> --
>> 2.17.1
>
More information about the stable
mailing list