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 3E67B42B83; Tue, 23 May 2023 20:49:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2BF542D3A; Tue, 23 May 2023 20:49:32 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 817A340A80; Tue, 23 May 2023 20:49:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684867769; x=1716403769; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Frj23hiAk5qBsV8F1Kiv9TzYc2VcjdMrdi5Hi/xKsVc=; b=UbejMS4BWbUPBH/q/T9xrZiHsIiJ8aO0H0E7dP0G8F+/lzx2LJ1qq5j8 LDKyUijSFSNYH89ku6y8rbqnaOKV7enYR9k89psIuI5yphUhlA/72Kezq qvWiKSlEiiJYgHwxwFx35G29cz6OJwTdUk18xm8EJSWWy2sRWQQr58KDw KuUz1JseZMallJ7G7MhixOOzevFE3P9SpqF4e6pnAWq8EaWgXPjmn28Ef s4/g3qVFcwCQIsEkOjf9QQKvcKO8pwVsDF7/tKrP7LFZxYaZBupsoFrZg dTqfwaM9cQh3msLXqihoMxuv6DkaBLLjZbg1DpG8NopaaQxHlEyQsdUA2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="439677942" X-IronPort-AV: E=Sophos;i="6.00,187,1681196400"; d="scan'208";a="439677942" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 11:49:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="878317347" X-IronPort-AV: E=Sophos;i="6.00,187,1681196400"; d="scan'208";a="878317347" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orsmga005.jf.intel.com with ESMTP; 23 May 2023 11:49:27 -0700 From: Hernan Vargas To: dev@dpdk.org, maxime.coquelin@redhat.com, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas , stable@dpdk.org Subject: [PATCH v1 2/6] baseband/fpga_5gnr_fec: fix seg fault unconf queue Date: Tue, 23 May 2023 11:48:14 -0700 Message-Id: <20230523184818.139353-3-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230523184818.139353-1-hernan.vargas@intel.com> References: <20230523184818.139353-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 Adding exception to prevent segmentation fault in case a queue is started which was not configured earlier. Fixes: c58109a8871d ("baseband/fpga_5gnr_fec: add queue configuration") Cc: stable@dpdk.org Signed-off-by: Hernan Vargas --- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c index 9388cce52960..a6211f73e6e3 100644 --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c @@ -573,6 +573,10 @@ fpga_queue_start(struct rte_bbdev *dev, uint16_t queue_id) return -1; } #endif + if (dev->data->queues[queue_id].queue_private == NULL) { + rte_bbdev_log(ERR, "Cannot start invalid queue %d", queue_id); + return -1; + } struct fpga_queue *q = dev->data->queues[queue_id].queue_private; uint32_t offset = FPGA_5GNR_FEC_RING_CTRL_REGS + (sizeof(struct fpga_ring_ctrl_reg) * q->q_idx); -- 2.37.1