patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Hernan Vargas <hernan.vargas@intel.com>
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 <hernan.vargas@intel.com>,
	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	[thread overview]
Message-ID: <20230523184818.139353-3-hernan.vargas@intel.com> (raw)
In-Reply-To: <20230523184818.139353-1-hernan.vargas@intel.com>

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 <hernan.vargas@intel.com>
---
 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


  parent reply	other threads:[~2023-05-23 18:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230523184818.139353-1-hernan.vargas@intel.com>
2023-05-23 18:48 ` [PATCH v1 1/6] baseband/fpga_5gnr_fec: fix possible div by zero Hernan Vargas
2023-05-23 19:26   ` Maxime Coquelin
2023-05-23 18:48 ` Hernan Vargas [this message]
2023-05-23 19:28   ` [PATCH v1 2/6] baseband/fpga_5gnr_fec: fix seg fault unconf queue Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230523184818.139353-3-hernan.vargas@intel.com \
    --to=hernan.vargas@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=nicolas.chautru@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).