From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C86B44C9F; Mon, 22 Oct 2018 07:46:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Oct 2018 22:46:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,410,1534834800"; d="scan'208";a="90211918" Received: from dpdk51.sh.intel.com ([10.67.110.190]) by FMSMGA003.fm.intel.com with ESMTP; 21 Oct 2018 22:46:04 -0700 From: Qi Zhang To: thomas@monjalon.net, ferruh.yigit@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Mon, 22 Oct 2018 13:47:11 +0800 Message-Id: <20181022054711.38683-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] bus/vdev: fix uninitialized device bus X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2018 05:46:07 -0000 Device bus should be initialized after bus scan. While it does not happened when scan vdev from secondary process, that cause segment fault at rte_dev_probe when call dev->bus->xxx. Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- drivers/bus/vdev/vdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 0142fb2c8..7d658fdf7 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -222,6 +222,7 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) goto fail; } + dev->device.bus = &rte_vdev_bus; dev->device.devargs = devargs; dev->device.numa_node = SOCKET_ID_ANY; dev->device.name = devargs->name; -- 2.13.6