DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: fix flow classifier creating failure
@ 2021-04-22  6:13 Min Hu (Connor)
  2021-04-22  9:51 ` Iremonger, Bernard
  0 siblings, 1 reply; 2+ messages in thread
From: Min Hu (Connor) @ 2021-04-22  6:13 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger

'cls->cls' will be NULL if flow classifier create has failed,
then segmentation fault will occur if the variable is used.

This patch fixed it.

Fixes: 9c9befea4f57 ("test: add flow classify unit tests")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test/test_flow_classify.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test/test_flow_classify.c b/app/test/test_flow_classify.c
index ef0b6fd..951606f 100644
--- a/app/test/test_flow_classify.c
+++ b/app/test/test_flow_classify.c
@@ -828,6 +828,12 @@ test_flow_classify(void)
 	cls_params.name = "flow_classifier";
 	cls_params.socket_id = 0;
 	cls->cls = rte_flow_classifier_create(&cls_params);
+	if (cls->cls == NULL) {
+		printf("Line %i: flow classifier create has failed!\n",
+		       __LINE__);
+		rte_free(cls);
+		return TEST_FAILED;
+	}
 
 	/* initialise ACL table params */
 	table_acl_params.n_rule_fields = RTE_DIM(ipv4_defs);
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH] test: fix flow classifier creating failure
  2021-04-22  6:13 [dpdk-dev] [PATCH] test: fix flow classifier creating failure Min Hu (Connor)
@ 2021-04-22  9:51 ` Iremonger, Bernard
  0 siblings, 0 replies; 2+ messages in thread
From: Iremonger, Bernard @ 2021-04-22  9:51 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 22, 2021 7:14 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>
> Subject: [PATCH] test: fix flow classifier creating failure
> 
> 'cls->cls' will be NULL if flow classifier create has failed, then segmentation
> fault will occur if the variable is used.
> 
> This patch fixed it.
> 
> Fixes: 9c9befea4f57 ("test: add flow classify unit tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

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

end of thread, other threads:[~2021-04-22  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  6:13 [dpdk-dev] [PATCH] test: fix flow classifier creating failure Min Hu (Connor)
2021-04-22  9:51 ` Iremonger, Bernard

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).