[dpdk-dev,1/2] net/i40e: fix segfault while devarg parsing
Checks
Commit Message
device.devargs can be null, don't access device.devargs->args without
null check.
Fixes: e0645348d7c6 ("net/i40e: add support for representor ports")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: declan.doherty@intel.com
---
drivers/net/i40e/i40e_ethdev.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On 4/27/2018 12:16 AM, Ferruh Yigit wrote:
> device.devargs can be null, don't access device.devargs->args without
> null check.
>
> Fixes: e0645348d7c6 ("net/i40e: add support for representor ports")
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: declan.doherty@intel.com
For series,
Squashed into relevant commit in next-net, thanks.
@@ -623,9 +623,12 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_eth_devargs eth_da = { .nb_representor_ports = 0 };
int i, retval;
- retval = rte_eth_devargs_parse(pci_dev->device.devargs->args, ð_da);
- if (retval)
- return retval;
+ if (pci_dev->device.devargs) {
+ retval = rte_eth_devargs_parse(pci_dev->device.devargs->args,
+ ð_da);
+ if (retval)
+ return retval;
+ }
/* physical port net_bdf_port */
snprintf(name, sizeof(name), "net_%s", pci_dev->device.name);