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 v2 1/6] baseband/fpga_5gnr_fec: fix possible div by zero
Date: Thu, 6 Jul 2023 11:10:36 +0200 [thread overview]
Message-ID: <d58e5263-e794-705f-9fb4-2ac553de19dd@redhat.com> (raw)
In-Reply-To: <20230525182812.152907-2-hernan.vargas@intel.com>
On 5/25/23 20:28, 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>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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..99390c48160c 100644
> --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
> +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
> @@ -877,9 +877,11 @@ check_desc_error(uint32_t error_code) {
> static inline uint16_t
> get_k0(uint16_t n_cb, uint16_t z_c, uint8_t bg, uint8_t rv_index)
> {
> + uint16_t n = (bg == 1 ? N_ZC_1 : N_ZC_2) * z_c;
> if (rv_index == 0)
> return 0;
> - uint16_t n = (bg == 1 ? N_ZC_1 : N_ZC_2) * z_c;
> + if (z_c == 0)
> + return 0;
> if (n_cb == n) {
> if (rv_index == 1)
> return (bg == 1 ? K0_1_1 : K0_1_2) * z_c;
Applied to dpdk-next-baseband/for-main.
Thanks,
Maxime
next prev parent reply other threads:[~2023-07-06 9:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230525182812.152907-1-hernan.vargas@intel.com>
2023-05-25 18:28 ` Hernan Vargas
2023-07-06 9:10 ` Maxime Coquelin
2023-07-06 9:10 ` Maxime Coquelin [this message]
2023-05-25 18:28 ` [PATCH v2 2/6] baseband/fpga_5gnr_fec: fix seg fault unconf queue Hernan Vargas
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=d58e5263-e794-705f-9fb4-2ac553de19dd@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).