From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CDF42A00C3; Mon, 15 Aug 2022 23:57:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B980F427EB; Mon, 15 Aug 2022 23:57:34 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 468AF410D3 for ; Mon, 15 Aug 2022 23:57:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660600653; x=1692136653; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SptOaxJDL4DE9GKwoDebSnfhYWFipGKGTzl3APfly80=; b=UbmL2BFj+cyIYihmY1GXFUB3ms47zQQj2zq/l+XCoebtE+E8Dfts1QVV wLgLT+BlUl0CNMROObvV2S3l23w0Ds3LAzoMhHORYfAgQ5+RGmLUwcnKA PPojP4xVJegG8c0lK1DHfmiIkP4pAmtvzq/RKCj/RbvxTjNBgsAeFbFKf clX101YeSIgcFAR/UO3Vcv7R9ZZXbN9Hu0bm2oDBlQnzhbRSksb1J3GtO 2QUy4dds6V7lZojpgWHCNWySErMCPFis1Yz2Fvy7pQIgBiSCq75kYpnFZ Sx2OhhRYxIIRkQXIo3pEa8lgxM9XsU+1pwjqZuD8MO8hg75JMjyryAt0w w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="292862703" X-IronPort-AV: E=Sophos;i="5.93,239,1654585200"; d="scan'208";a="292862703" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2022 14:57:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,239,1654585200"; d="scan'208";a="666826020" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by fmsmga008.fm.intel.com with ESMTP; 15 Aug 2022 14:57:31 -0700 From: Hernan Vargas To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v1 02/33] baseband/acc100: quit queue setup for undef dev Date: Mon, 15 Aug 2022 22:52:27 -0700 Message-Id: <20220816055258.107564-3-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220816055258.107564-1-hernan.vargas@intel.com> References: <20220816055258.107564-1-hernan.vargas@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Move check for undefined device before allocating queue data structure. Signed-off-by: Hernan Vargas --- drivers/baseband/acc100/rte_acc100_pmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index 8b13a96307..b7daef3d84 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -831,6 +831,10 @@ acc100_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, struct acc100_queue *q; int16_t q_idx; + if (d == NULL) { + rte_bbdev_log(ERR, "Undefined device"); + return -ENODEV; + } /* Allocate the queue data structure. */ q = rte_zmalloc_socket(dev->device->driver->name, sizeof(*q), RTE_CACHE_LINE_SIZE, conf->socket); @@ -838,10 +842,6 @@ acc100_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, rte_bbdev_log(ERR, "Failed to allocate queue memory"); return -ENOMEM; } - if (d == NULL) { - rte_bbdev_log(ERR, "Undefined device"); - return -ENODEV; - } q->d = d; q->ring_addr = RTE_PTR_ADD(d->sw_rings, (d->sw_ring_size * queue_id)); -- 2.37.1