DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/7] regex/mlx5: fix jump to the wrong label
@ 2020-11-18 17:00 Michael Baum
  2020-11-18 17:00 ` [dpdk-dev] [PATCH 2/7] regex/mlx5: fix iterator type in RXP engines management Michael Baum
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Michael Baum @ 2020-11-18 17:00 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko, stable

The mlx5_regex_pci_probe function allocates a mlx5_regex_priv structure
using rte_zmalloc.

If the allocation fails, the function jumps to the dev_error label in
order to release previously allocated resources in the function.
However, in the dev_error label it attempts to refer to the internal
fields of the priv structure and if its allocation fails (as in this
case) it is actually dereferencing to NULL.

Replace the jump with an error label.

Fixes: 1db6ebd4ef58 ("regex/mlx5: fix crash on initialization failure")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/regex/mlx5/mlx5_regex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
index 05048e7..c91c444 100644
--- a/drivers/regex/mlx5/mlx5_regex.c
+++ b/drivers/regex/mlx5/mlx5_regex.c
@@ -157,7 +157,7 @@
 	if (!priv) {
 		DRV_LOG(ERR, "Failed to allocate private memory.");
 		rte_errno = ENOMEM;
-		goto error;
+		goto dev_error;
 	}
 	priv->ctx = ctx;
 	priv->nb_engines = 2; /* attr.regexp_num_of_engines */
-- 
1.8.3.1


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

end of thread, other threads:[~2020-11-22 14:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 17:00 [dpdk-dev] [PATCH 1/7] regex/mlx5: fix jump to the wrong label Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 2/7] regex/mlx5: fix iterator type in RXP engines management Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 3/7] regex/mlx5: fix unnecessary init in RXP handle Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 4/7] regex/mlx5: fix unchecked return value " Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 5/7] regex/mlx5: improve error messages in RXP rules flush Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 6/7] regex/mlx5: improve constants type in QP buffers creation Michael Baum
2020-11-22 13:58   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2020-11-18 17:00 ` [dpdk-dev] [PATCH 7/7] regex/mlx5: fix QP setuping error flow Michael Baum
2020-11-22 14:06 ` [dpdk-dev] [dpdk-stable] [PATCH 1/7] regex/mlx5: fix jump to the wrong label Thomas Monjalon

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