DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/regex: avoid division by zero
@ 2021-05-24  8:57 Thierry Herbelot
  2021-05-24 12:09 ` [dpdk-dev] [dpdk-stable] " Min Hu (Connor)
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Herbelot @ 2021-05-24  8:57 UTC (permalink / raw)
  To: dev; +Cc: Thierry Herbelot, Thomas Monjalon, stable, Ori Kam

Check that nb_jobs is not zero before using it for a division.

Fixes: f5cffb7eb7fb6 ("app/regex: read data file once at startup")
Cc: stable@dpdk.org
Cc: Ori Kam <orika@nvidia.com>

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
---
 app/test-regex/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-regex/main.c b/app/test-regex/main.c
index 8e665df73ce0..8f48cab11924 100644
--- a/app/test-regex/main.c
+++ b/app/test-regex/main.c
@@ -714,6 +714,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Number of QPs must be greater than 0\n");
 	if (nb_lcores == 0)
 		rte_exit(EXIT_FAILURE, "Number of lcores must be greater than 0\n");
+	if (nb_jobs == 0)
+		rte_exit(EXIT_FAILURE, "Number of jobs must be greater than 0\n");
 	if (distribute_qps_to_lcores(nb_lcores, nb_qps, &qps_per_lcore) < 0)
 		rte_exit(EXIT_FAILURE, "Failed to distribute queues to lcores!\n");
 	ret = init_port(&nb_max_payload, rules_file,
-- 
2.29.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/regex: avoid division by zero
  2021-05-24  8:57 [dpdk-dev] [PATCH] app/regex: avoid division by zero Thierry Herbelot
@ 2021-05-24 12:09 ` Min Hu (Connor)
  0 siblings, 0 replies; 2+ messages in thread
From: Min Hu (Connor) @ 2021-05-24 12:09 UTC (permalink / raw)
  To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, stable, Ori Kam

Hi, Thierry,
	This bug has been fixed in my earlier patch, please refer to:
https://patches.dpdk.org/project/dpdk/patch/1618839289-33224-5-git-send-email-humin29@huawei.com/

	Thanks.


在 2021/5/24 16:57, Thierry Herbelot 写道:
> Check that nb_jobs is not zero before using it for a division.
> 
> Fixes: f5cffb7eb7fb6 ("app/regex: read data file once at startup")
> Cc: stable@dpdk.org
> Cc: Ori Kam <orika@nvidia.com>
> 
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> ---
>   app/test-regex/main.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/app/test-regex/main.c b/app/test-regex/main.c
> index 8e665df73ce0..8f48cab11924 100644
> --- a/app/test-regex/main.c
> +++ b/app/test-regex/main.c
> @@ -714,6 +714,8 @@ main(int argc, char **argv)
>   		rte_exit(EXIT_FAILURE, "Number of QPs must be greater than 0\n");
>   	if (nb_lcores == 0)
>   		rte_exit(EXIT_FAILURE, "Number of lcores must be greater than 0\n");
> +	if (nb_jobs == 0)
> +		rte_exit(EXIT_FAILURE, "Number of jobs must be greater than 0\n");
>   	if (distribute_qps_to_lcores(nb_lcores, nb_qps, &qps_per_lcore) < 0)
>   		rte_exit(EXIT_FAILURE, "Failed to distribute queues to lcores!\n");
>   	ret = init_port(&nb_max_payload, rules_file,
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-24 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24  8:57 [dpdk-dev] [PATCH] app/regex: avoid division by zero Thierry Herbelot
2021-05-24 12:09 ` [dpdk-dev] [dpdk-stable] " Min Hu (Connor)

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git