From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH] app/testpmd: fix crash when doing port info of vdev Date: Fri, 15 Feb 2019 17:36:46 -0800 Message-ID: <20190216013646.9738-1-stephen@networkplumber.org> Cc: stable@dpdk.org, Stephen Hemminger To: dev@dpdk.org Return-path: Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 6D3741B4CF for ; Sat, 16 Feb 2019 02:36:51 +0100 (CET) Received: by mail-pf1-f195.google.com with SMTP id j5so1174627pfa.2 for ; Fri, 15 Feb 2019 17:36:51 -0800 (PST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger Noticed a SEGV in testpmd doing: > show port info 1 on Hyper-V with failsafe/tap PMD. A vdev may not have an associated device (i.e NULL) and therefore testpmd should skip devargs in that case. Fixes: cf72ed09181b ("app/testpmd: display devargs in port info output") Signed-off-by: Stephen Hemminger --- app/test-pmd/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index b9e5dd923b0f..38708db943d2 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -415,7 +415,8 @@ port_infos_display(portid_t port_id) rte_eth_dev_get_name_by_port(port_id, name); printf("\nDevice name: %s", name); printf("\nDriver name: %s", dev_info.driver_name); - if (dev_info.device->devargs && dev_info.device->devargs->args) + if (dev_info.device && dev_info.device->devargs && + dev_info.device->devargs->args) printf("\nDevargs: %s", dev_info.device->devargs->args); printf("\nConnect to socket: %u", port->socket_id); -- 2.17.1