From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [PATCH v6 2/2] vhost: Add VHOST PMD Date: Wed, 3 Feb 2016 16:48:17 +0900 Message-ID: <56B1B0C1.2070500@igel.co.jp> References: <1448355603-21275-2-git-send-email-mukawa@igel.co.jp> <1454411922-5597-3-git-send-email-mukawa@igel.co.jp> <20160202234319.GA925@sivlogin002.ir.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, ann.zhuangyanying@huawei.com, yuanhan.liu@intel.com To: Ferruh Yigit Return-path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 59D1893C0 for ; Wed, 3 Feb 2016 08:48:20 +0100 (CET) Received: by mail-pf0-f172.google.com with SMTP id n128so9408959pfn.3 for ; Tue, 02 Feb 2016 23:48:20 -0800 (PST) In-Reply-To: <20160202234319.GA925@sivlogin002.ir.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2016/02/03 8:43, Ferruh Yigit wrote: > On Tue, Feb 02, 2016 at 08:18:42PM +0900, Tetsuya Mukawa wrote: >> + >> + /* find an ethdev entry */ >> + eth_dev = rte_eth_dev_allocated(name); >> + if (eth_dev == NULL) >> + return -ENODEV; >> + >> + internal = eth_dev->data->dev_private; >> + >> + rte_free(vring_states[internal->port_id]); >> + vring_states[internal->port_id] = NULL; >> + >> + pthread_mutex_lock(&internal_list_lock); >> + TAILQ_REMOVE(&internals_list, internal, next); >> + pthread_mutex_unlock(&internal_list_lock); >> + >> + eth_dev_stop(eth_dev); >> + >> + if ((internal) && (internal->dev_name)) > if "internal" can be NULL, above internal->port_id reference will crash, if can't be NULL no need to check here. > > Hi Ferruh, I guess if internal is NULL, "internal->dev_name" will not be accessed. So it may be ok to stay above code. Tetsuya