From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1B9C2A0679 for ; Thu, 4 Apr 2019 08:23:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 403B34F91; Thu, 4 Apr 2019 08:23:06 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 354114D3A for ; Thu, 4 Apr 2019 08:23:04 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 23:23:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208";a="140003570" Received: from dpdk-tbie.sh.intel.com ([10.67.104.173]) by fmsmga007.fm.intel.com with ESMTP; 03 Apr 2019 23:23:01 -0700 Date: Thu, 4 Apr 2019 14:22:35 +0800 From: Tiwei Bie To: Mohammad Abdul Awal Cc: dev@dpdk.org, maxime.coquelin@redhat.com, zhihong.wang@intel.com Message-ID: <20190404062235.GA8201@dpdk-tbie.sh.intel.com> References: <20190403160811.1282-1-mohammad.abdul.awal@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <20190403160811.1282-1-mohammad.abdul.awal@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH 2/3] net/virtio: fix null pointer checking 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190404062235.jMcEaTkGxNruAwKu5vEZucz-ygfxeybkZJh7m_amxMo@z> On Wed, Apr 03, 2019 at 05:08:11PM +0100, Mohammad Abdul Awal wrote: > Null value of device name should return error without further processing. > > Fixes: 1c8489da56 ("net/virtio-user: fix multi-process support") > > Signed-off-by: Mohammad Abdul Awal > --- > drivers/net/virtio/virtio_user_ethdev.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c > index 129c2b9ef..cefc6da66 100644 > --- a/drivers/net/virtio/virtio_user_ethdev.c > +++ b/drivers/net/virtio/virtio_user_ethdev.c > @@ -516,6 +516,10 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev) > > if (rte_eal_process_type() == RTE_PROC_SECONDARY) { > const char *name = rte_vdev_device_name(dev); > + if (name == NULL) { > + RTE_LOG(ERR, PMD, "Device name is NULL\n"); > + return -1; > + } It seems there is a lot of code in DPDK doesn't do the null pointer check in this case. Is it worth fixing them as well? Or should vdev bus guarantee that it won't ask driver to probe a device without device name (without a device name, vdev bus shouldn't be able to find a driver to probe actually)? Thanks, Tiwei > eth_dev = rte_eth_dev_attach_secondary(name); > if (!eth_dev) { > RTE_LOG(ERR, PMD, "Failed to probe %s\n", name); > -- > 2.17.1 >