patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Hernan Vargas <hernan.vargas@intel.com>,
	dev@dpdk.org, gakhil@marvell.com, trix@redhat.com
Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, stable@dpdk.org
Subject: Re: [PATCH v1 2/6] baseband/fpga_5gnr_fec: fix seg fault unconf queue
Date: Tue, 23 May 2023 21:28:08 +0200	[thread overview]
Message-ID: <a3a0138d-f0a2-f49a-2091-831c265bdc80@redhat.com> (raw)
In-Reply-To: <20230523184818.139353-3-hernan.vargas@intel.com>



On 5/23/23 20:48, Hernan Vargas wrote:
> 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);

Same comment here for offset and q declarations, it should be at the top
of the function.

Maxime


      reply	other threads:[~2023-05-23 19:28 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 ` [PATCH v1 2/6] baseband/fpga_5gnr_fec: fix seg fault unconf queue Hernan Vargas
2023-05-23 19:28   ` Maxime Coquelin [this message]

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=a3a0138d-f0a2-f49a-2091-831c265bdc80@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hernan.vargas@intel.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).