From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by dpdk.org (Postfix) with ESMTP id 78ED6292D; Fri, 23 Jun 2017 14:41:46 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id v5NCficv021677 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 23 Jun 2017 05:41:44 -0700 (PDT) Received: from yow-cgts4-lx.wrs.com (128.224.145.137) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 23 Jun 2017 05:41:44 -0700 From: Allain Legacy To: , CC: , Date: Fri, 23 Jun 2017 08:41:37 -0400 Message-ID: <20170623124137.61091-1-allain.legacy@windriver.com> X-Mailer: git-send-email 2.12.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [128.224.145.137] Subject: [dpdk-stable] [PATCH] net/virtio-user: fix crash when detaching device X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 12:41:47 -0000 The rte_eth_dev.data pointer is set to a reference to a static table. Attempting to rte_free() it leads to a panic. For example, the following commands result in a panic if run in testpmd testpmd> port attach virtio_user0,path=/dev/vhost-net,iface=test0 testpmd> port stop 2 testpmd> port close 2 testpmd> port detach 2 Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device") Signed-off-by: Allain Legacy --- drivers/net/virtio/virtio_user_ethdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 280406c02..e9af946e8 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -556,7 +556,6 @@ virtio_user_pmd_remove(struct rte_vdev_device *vdev) virtio_user_dev_uninit(dev); rte_free(eth_dev->data->dev_private); - rte_free(eth_dev->data); rte_eth_dev_release_port(eth_dev); return 0; -- 2.12.1