From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Beilei Xing <beilei.xing@intel.com>,
Qi Zhang <qi.z.zhang@intel.com>,
Wenzhuo Lu <wenzhuo.lu@intel.com>,
Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,
declan.doherty@intel.com
Subject: [dpdk-dev] [PATCH 2/2] net/ixgbe: fix segfault while devarg parsing
Date: Fri, 27 Apr 2018 00:16:47 +0100 [thread overview]
Message-ID: <20180426231647.239502-2-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20180426231647.239502-1-ferruh.yigit@intel.com>
device.devargs can be null, don't access device.devargs->args without
null check.
Fixes: 3be5d686539c ("net/ixgbe: add support for representor ports")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: declan.doherty@intel.com
---
drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 15686da10..6088c7e48 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1729,9 +1729,12 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_eth_devargs eth_da;
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_%d", pci_dev->device.name, 0);
--
2.14.3
next prev parent reply other threads:[~2018-04-26 23:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 23:16 [dpdk-dev] [PATCH 1/2] net/i40e: " Ferruh Yigit
2018-04-26 23:16 ` Ferruh Yigit [this message]
2018-04-26 23:24 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180426231647.239502-2-ferruh.yigit@intel.com \
--to=ferruh.yigit@intel.com \
--cc=beilei.xing@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).