DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eventdev: fix control flow issues
@ 2019-04-24 16:34 Abhinandan Gujjar
  2019-04-24 16:34 ` Abhinandan Gujjar
  2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
  0 siblings, 2 replies; 10+ messages in thread
From: Abhinandan Gujjar @ 2019-04-24 16:34 UTC (permalink / raw)
  To: jerin.jacob, dev; +Cc: narender.vangati, abhinandan.gujjar, john.mcnamara

This patch fixes null pointer dereference and control
flow issues reported in event crypto adapter by coverity

Coverity issue: 279439 Dereference null return value
Coverity issue: 279446 Logically dead code
Coverity issue: 279450 Logically dead code
Coverity issue: 279462 Logically dead code
Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 11b28ca..5faf3c9 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -159,6 +159,9 @@ struct crypto_queue_pair_info {
 	struct rte_event_port_conf *port_conf = arg;
 	struct rte_event_crypto_adapter *adapter = eca_id_to_adapter(id);
 
+	if (adapter == NULL)
+		return -EINVAL;
+
 	dev = &rte_eventdevs[adapter->eventdev_id];
 	dev_conf = dev->data->dev_conf;
 
@@ -353,7 +356,7 @@ struct crypto_queue_pair_info {
 			cdev_id = m_data->request_info.cdev_id;
 			qp_id = m_data->request_info.queue_pair_id;
 			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
-			if (qp_info == NULL) {
+			if (!qp_info->qp_enabled) {
 				rte_pktmbuf_free(crypto_op->sym->m_src);
 				rte_crypto_op_free(crypto_op);
 				continue;
@@ -369,7 +372,7 @@ struct crypto_queue_pair_info {
 			cdev_id = m_data->request_info.cdev_id;
 			qp_id = m_data->request_info.queue_pair_id;
 			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
-			if (qp_info == NULL) {
+			if (!qp_info->qp_enabled) {
 				rte_pktmbuf_free(crypto_op->sym->m_src);
 				rte_crypto_op_free(crypto_op);
 				continue;
@@ -427,10 +430,9 @@ struct crypto_queue_pair_info {
 	ret = 0;
 	for (cdev_id = 0; cdev_id < num_cdev; cdev_id++) {
 		curr_dev = &adapter->cdevs[cdev_id];
-		if (curr_dev == NULL)
-			continue;
 		dev = curr_dev->dev;
-
+		if (dev == NULL)
+			continue;
 		for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
 
 			curr_queue = &curr_dev->qpairs[qp];
@@ -579,9 +581,9 @@ struct crypto_queue_pair_info {
 		for (cdev_id = adapter->next_cdev_id;
 			cdev_id < num_cdev; cdev_id++) {
 			curr_dev = &adapter->cdevs[cdev_id];
-			if (curr_dev == NULL)
-				continue;
 			dev = curr_dev->dev;
+			if (dev == NULL)
+				continue;
 			dev_qps = dev->data->nb_queue_pairs;
 
 			for (qp = curr_dev->next_queue_pair_id;
-- 
1.9.1

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

* [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-24 16:34 [dpdk-dev] [PATCH] eventdev: fix control flow issues Abhinandan Gujjar
@ 2019-04-24 16:34 ` Abhinandan Gujjar
  2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
  1 sibling, 0 replies; 10+ messages in thread
From: Abhinandan Gujjar @ 2019-04-24 16:34 UTC (permalink / raw)
  To: jerin.jacob, dev; +Cc: narender.vangati, abhinandan.gujjar, john.mcnamara

This patch fixes null pointer dereference and control
flow issues reported in event crypto adapter by coverity

Coverity issue: 279439 Dereference null return value
Coverity issue: 279446 Logically dead code
Coverity issue: 279450 Logically dead code
Coverity issue: 279462 Logically dead code
Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/librte_eventdev/rte_event_crypto_adapter.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
index 11b28ca..5faf3c9 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.c
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -159,6 +159,9 @@ struct crypto_queue_pair_info {
 	struct rte_event_port_conf *port_conf = arg;
 	struct rte_event_crypto_adapter *adapter = eca_id_to_adapter(id);
 
+	if (adapter == NULL)
+		return -EINVAL;
+
 	dev = &rte_eventdevs[adapter->eventdev_id];
 	dev_conf = dev->data->dev_conf;
 
@@ -353,7 +356,7 @@ struct crypto_queue_pair_info {
 			cdev_id = m_data->request_info.cdev_id;
 			qp_id = m_data->request_info.queue_pair_id;
 			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
-			if (qp_info == NULL) {
+			if (!qp_info->qp_enabled) {
 				rte_pktmbuf_free(crypto_op->sym->m_src);
 				rte_crypto_op_free(crypto_op);
 				continue;
@@ -369,7 +372,7 @@ struct crypto_queue_pair_info {
 			cdev_id = m_data->request_info.cdev_id;
 			qp_id = m_data->request_info.queue_pair_id;
 			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
-			if (qp_info == NULL) {
+			if (!qp_info->qp_enabled) {
 				rte_pktmbuf_free(crypto_op->sym->m_src);
 				rte_crypto_op_free(crypto_op);
 				continue;
@@ -427,10 +430,9 @@ struct crypto_queue_pair_info {
 	ret = 0;
 	for (cdev_id = 0; cdev_id < num_cdev; cdev_id++) {
 		curr_dev = &adapter->cdevs[cdev_id];
-		if (curr_dev == NULL)
-			continue;
 		dev = curr_dev->dev;
-
+		if (dev == NULL)
+			continue;
 		for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
 
 			curr_queue = &curr_dev->qpairs[qp];
@@ -579,9 +581,9 @@ struct crypto_queue_pair_info {
 		for (cdev_id = adapter->next_cdev_id;
 			cdev_id < num_cdev; cdev_id++) {
 			curr_dev = &adapter->cdevs[cdev_id];
-			if (curr_dev == NULL)
-				continue;
 			dev = curr_dev->dev;
+			if (dev == NULL)
+				continue;
 			dev_qps = dev->data->nb_queue_pairs;
 
 			for (qp = curr_dev->next_queue_pair_id;
-- 
1.9.1


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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-24 16:34 [dpdk-dev] [PATCH] eventdev: fix control flow issues Abhinandan Gujjar
  2019-04-24 16:34 ` Abhinandan Gujjar
@ 2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
  2019-04-26  8:00   ` Jerin Jacob Kollanukkaran
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-04-26  8:00 UTC (permalink / raw)
  To: Abhinandan Gujjar, jerin.jacob, dev; +Cc: narender.vangati, john.mcnamara

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Abhinandan Gujjar
> Sent: Wednesday, April 24, 2019 10:05 PM
> To: jerin.jacob@caviumnetworks.com; dev@dpdk.org
> Cc: narender.vangati@intel.com; abhinandan.gujjar@intel.com;
> john.mcnamara@intel.com
> Subject: [dpdk-dev] [PATCH] eventdev: fix control flow issues
> 
> This patch fixes null pointer dereference and control flow issues reported in
> event crypto adapter by coverity
> 
> Coverity issue: 279439 Dereference null return value Coverity issue: 279446
> Logically dead code Coverity issue: 279450 Logically dead code Coverity issue:
> 279462 Logically dead code
> Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")

Cc: stable@dpdk.org

> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>

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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
@ 2019-04-26  8:00   ` Jerin Jacob Kollanukkaran
  2019-04-30  9:44   ` Mcnamara, John
  2019-05-01 21:11   ` Thomas Monjalon
  2 siblings, 0 replies; 10+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-04-26  8:00 UTC (permalink / raw)
  To: Abhinandan Gujjar, jerin.jacob, dev; +Cc: narender.vangati, john.mcnamara

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Abhinandan Gujjar
> Sent: Wednesday, April 24, 2019 10:05 PM
> To: jerin.jacob@caviumnetworks.com; dev@dpdk.org
> Cc: narender.vangati@intel.com; abhinandan.gujjar@intel.com;
> john.mcnamara@intel.com
> Subject: [dpdk-dev] [PATCH] eventdev: fix control flow issues
> 
> This patch fixes null pointer dereference and control flow issues reported in
> event crypto adapter by coverity
> 
> Coverity issue: 279439 Dereference null return value Coverity issue: 279446
> Logically dead code Coverity issue: 279450 Logically dead code Coverity issue:
> 279462 Logically dead code
> Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")

Cc: stable@dpdk.org

> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>



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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
  2019-04-26  8:00   ` Jerin Jacob Kollanukkaran
@ 2019-04-30  9:44   ` Mcnamara, John
  2019-04-30  9:44     ` Mcnamara, John
  2019-04-30 17:08     ` Jerin Jacob Kollanukkaran
  2019-05-01 21:11   ` Thomas Monjalon
  2 siblings, 2 replies; 10+ messages in thread
From: Mcnamara, John @ 2019-04-30  9:44 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran, Gujjar, Abhinandan S, jerin.jacob, dev
  Cc: Vangati, Narender

> > Coverity issue: 279439 Dereference null return value Coverity issue:
> > 279446 Logically dead code Coverity issue: 279450 Logically dead code
> Coverity issue:
> > 279462 Logically dead code
> > Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
> 
> Cc: stable@dpdk.org
> 
> >
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Hi Jerin,

Can you apply this patch for RC3. It potentially fixes 4 coverity defcts.

Thanks,

John

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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-30  9:44   ` Mcnamara, John
@ 2019-04-30  9:44     ` Mcnamara, John
  2019-04-30 17:08     ` Jerin Jacob Kollanukkaran
  1 sibling, 0 replies; 10+ messages in thread
From: Mcnamara, John @ 2019-04-30  9:44 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran, Gujjar, Abhinandan S, jerin.jacob, dev
  Cc: Vangati, Narender

> > Coverity issue: 279439 Dereference null return value Coverity issue:
> > 279446 Logically dead code Coverity issue: 279450 Logically dead code
> Coverity issue:
> > 279462 Logically dead code
> > Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
> 
> Cc: stable@dpdk.org
> 
> >
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Hi Jerin,

Can you apply this patch for RC3. It potentially fixes 4 coverity defcts.

Thanks,

John



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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-30  9:44   ` Mcnamara, John
  2019-04-30  9:44     ` Mcnamara, John
@ 2019-04-30 17:08     ` Jerin Jacob Kollanukkaran
  2019-04-30 17:08       ` Jerin Jacob Kollanukkaran
  1 sibling, 1 reply; 10+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-04-30 17:08 UTC (permalink / raw)
  To: Mcnamara, John, Gujjar, Abhinandan S, dev,
	Jerin Jacob Kollanukkaran, thomas
  Cc: Vangati, Narender



> -----Original Message-----
> From: Mcnamara, John <john.mcnamara@intel.com>
> Sent: Tuesday, April 30, 2019 3:14 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; jerin.jacob@caviumnetworks.com;
> dev@dpdk.org
> Cc: Vangati, Narender <narender.vangati@intel.com>
> Subject: [EXT] RE: [dpdk-dev] [PATCH] eventdev: fix control flow issues

> > > Coverity issue: 279439 Dereference null return value Coverity issue:
> > > 279446 Logically dead code Coverity issue: 279450 Logically dead code
> > Coverity issue:
> > > 279462 Logically dead code
> > > Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
> >
> > Cc: stable@dpdk.org
> >
> > >
> > > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> >
> > Acked-by: Jerin Jacob <jerinj@marvell.com>
> 
> Hi Jerin,
> 
> Can you apply this patch for RC3. It potentially fixes 4 coverity defcts.

Thomas,

Could you merge this patch to avoid creating pull request for one patch.

> 
> Thanks,
> 
> John
> 

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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-30 17:08     ` Jerin Jacob Kollanukkaran
@ 2019-04-30 17:08       ` Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 10+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-04-30 17:08 UTC (permalink / raw)
  To: Mcnamara, John, Gujjar, Abhinandan S, dev,
	Jerin Jacob Kollanukkaran, thomas
  Cc: Vangati, Narender



> -----Original Message-----
> From: Mcnamara, John <john.mcnamara@intel.com>
> Sent: Tuesday, April 30, 2019 3:14 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; jerin.jacob@caviumnetworks.com;
> dev@dpdk.org
> Cc: Vangati, Narender <narender.vangati@intel.com>
> Subject: [EXT] RE: [dpdk-dev] [PATCH] eventdev: fix control flow issues

> > > Coverity issue: 279439 Dereference null return value Coverity issue:
> > > 279446 Logically dead code Coverity issue: 279450 Logically dead code
> > Coverity issue:
> > > 279462 Logically dead code
> > > Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
> >
> > Cc: stable@dpdk.org
> >
> > >
> > > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> >
> > Acked-by: Jerin Jacob <jerinj@marvell.com>
> 
> Hi Jerin,
> 
> Can you apply this patch for RC3. It potentially fixes 4 coverity defcts.

Thomas,

Could you merge this patch to avoid creating pull request for one patch.

> 
> Thanks,
> 
> John
> 


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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
  2019-04-26  8:00   ` Jerin Jacob Kollanukkaran
  2019-04-30  9:44   ` Mcnamara, John
@ 2019-05-01 21:11   ` Thomas Monjalon
  2019-05-01 21:11     ` Thomas Monjalon
  2 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-01 21:11 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: dev, Jerin Jacob Kollanukkaran, jerin.jacob, narender.vangati,
	john.mcnamara

> > This patch fixes null pointer dereference and control flow issues reported in
> > event crypto adapter by coverity
> > 
> > Coverity issue: 279439 Dereference null return value Coverity issue: 279446
> > Logically dead code Coverity issue: 279450 Logically dead code Coverity issue:
> > 279462 Logically dead code
> > Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
> 
> Cc: stable@dpdk.org
> 
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] eventdev: fix control flow issues
  2019-05-01 21:11   ` Thomas Monjalon
@ 2019-05-01 21:11     ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-01 21:11 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: dev, Jerin Jacob Kollanukkaran, jerin.jacob, narender.vangati,
	john.mcnamara

> > This patch fixes null pointer dereference and control flow issues reported in
> > event crypto adapter by coverity
> > 
> > Coverity issue: 279439 Dereference null return value Coverity issue: 279446
> > Logically dead code Coverity issue: 279450 Logically dead code Coverity issue:
> > 279462 Logically dead code
> > Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
> 
> Cc: stable@dpdk.org
> 
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks




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

end of thread, other threads:[~2019-05-01 21:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 16:34 [dpdk-dev] [PATCH] eventdev: fix control flow issues Abhinandan Gujjar
2019-04-24 16:34 ` Abhinandan Gujjar
2019-04-26  8:00 ` Jerin Jacob Kollanukkaran
2019-04-26  8:00   ` Jerin Jacob Kollanukkaran
2019-04-30  9:44   ` Mcnamara, John
2019-04-30  9:44     ` Mcnamara, John
2019-04-30 17:08     ` Jerin Jacob Kollanukkaran
2019-04-30 17:08       ` Jerin Jacob Kollanukkaran
2019-05-01 21:11   ` Thomas Monjalon
2019-05-01 21:11     ` Thomas Monjalon

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