From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D1F772BA2 for ; Wed, 1 May 2019 21:50:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 May 2019 12:50:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,418,1549958400"; d="scan'208";a="140463408" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga006.jf.intel.com with ESMTP; 01 May 2019 12:50:27 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , shreyansh.jain@nxp.com Date: Wed, 1 May 2019 20:50:13 +0100 Message-Id: <20190501195014.2938-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190501195014.2938-1-bruce.richardson@intel.com> References: <20190501195014.2938-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/4] raw/skeleton_rawdev: fix warnings with GCC 9 on Fedora 30 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: Wed, 01 May 2019 19:50:29 -0000 GCC9 gives warnings if the parameter passed to printf for "%s" could be NULL, so we need to add checks in some cases to ensure that is not the case. Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver") Cc: shreyansh.jain@nxp.com Signed-off-by: Bruce Richardson --- drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c index d7630fc69..63f2b9a09 100644 --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c @@ -705,6 +705,9 @@ skeleton_rawdev_probe(struct rte_vdev_device *vdev) name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + /* More than one instance is not supported */ if (skeldev_init_once) { SKELETON_PMD_ERR("Multiple instance not supported for %s", @@ -740,6 +743,8 @@ skeleton_rawdev_remove(struct rte_vdev_device *vdev) int ret; name = rte_vdev_device_name(vdev); + if (name == NULL) + return -1; SKELETON_PMD_INFO("Closing %s on NUMA node %d", name, rte_socket_id()); -- 2.21.0 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 CAC17A0AC5 for ; Wed, 1 May 2019 21:50:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F1E02BA2; Wed, 1 May 2019 21:50:31 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D1F772BA2 for ; Wed, 1 May 2019 21:50:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 May 2019 12:50:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,418,1549958400"; d="scan'208";a="140463408" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga006.jf.intel.com with ESMTP; 01 May 2019 12:50:27 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , shreyansh.jain@nxp.com Date: Wed, 1 May 2019 20:50:13 +0100 Message-Id: <20190501195014.2938-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190501195014.2938-1-bruce.richardson@intel.com> References: <20190501195014.2938-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/4] raw/skeleton_rawdev: fix warnings with GCC 9 on Fedora 30 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190501195013.ZAIDu-BeogSa8dm6j0NaGKRUBaAuyrzRHUaN3PMCIL0@z> GCC9 gives warnings if the parameter passed to printf for "%s" could be NULL, so we need to add checks in some cases to ensure that is not the case. Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver") Cc: shreyansh.jain@nxp.com Signed-off-by: Bruce Richardson --- drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c index d7630fc69..63f2b9a09 100644 --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c @@ -705,6 +705,9 @@ skeleton_rawdev_probe(struct rte_vdev_device *vdev) name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + /* More than one instance is not supported */ if (skeldev_init_once) { SKELETON_PMD_ERR("Multiple instance not supported for %s", @@ -740,6 +743,8 @@ skeleton_rawdev_remove(struct rte_vdev_device *vdev) int ret; name = rte_vdev_device_name(vdev); + if (name == NULL) + return -1; SKELETON_PMD_INFO("Closing %s on NUMA node %d", name, rte_socket_id()); -- 2.21.0