DPDK patches and discussions
 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 1/6] baseband/fpga_5gnr_fec: fix possible div by zero
Date: Tue, 23 May 2023 21:26:57 +0200	[thread overview]
Message-ID: <7f019233-69cd-564f-6b03-90fa8455ec39@redhat.com> (raw)
In-Reply-To: <20230523184818.139353-2-hernan.vargas@intel.com>



On 5/23/23 20:48, Hernan Vargas wrote:
> Add fix to have an early exit when z_c is zero to prevent a possible
> division by zero.
> 
> Fixes: 44dc6faa796f ("baseband/fpga_5gnr_fec: add LDPC processing functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 ++
>   1 file changed, 2 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 f29565af8cca..9388cce52960 100644
> --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
> +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
> @@ -879,6 +879,8 @@ get_k0(uint16_t n_cb, uint16_t z_c, uint8_t bg, uint8_t rv_index)
>   {
>   	if (rv_index == 0)
>   		return 0;
> +	if (z_c == 0)
> +		return 0;
>   	uint16_t n = (bg == 1 ? N_ZC_1 : N_ZC_2) * z_c;

You could take the opportunity to move n declaration at the top of the
function.

We this done, feel free to add:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


>   	if (n_cb == n) {
>   		if (rv_index == 1)


  reply	other threads:[~2023-05-23 19:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 18:48 [PATCH v1 0/6] baseband/fpga_5gnr_fec: changes for 23.07 Hernan Vargas
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 [this message]
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
2023-05-23 18:48 ` [PATCH v1 3/6] baseband/fpga_5gnr_fec: renaming for consistency Hernan Vargas
2023-05-23 18:48 ` [PATCH v1 4/6] baseband/fpga_5gnr_fec: add Vista Creek variant Hernan Vargas
2023-05-23 18:48 ` [PATCH v1 5/6] baseband/fpga_5gnr_fec: add AGX100 support Hernan Vargas
2023-05-23 18:48 ` [PATCH v1 6/6] baseband/fpga_5gnr_fec: cosmetic comment changes Hernan Vargas
2023-05-23 19:20 ` [PATCH v1 0/6] baseband/fpga_5gnr_fec: changes for 23.07 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=7f019233-69cd-564f-6b03-90fa8455ec39@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).