DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/enic: fix uninitialized variable
@ 2018-04-17 23:53 John Daley
  2018-04-18  0:00 ` [dpdk-dev] [PATCH v2] " John Daley
  0 siblings, 1 reply; 3+ messages in thread
From: John Daley @ 2018-04-17 23:53 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, John Daley

A local variable was used without initialization and triggered a coverity
issue.

Is is fixed here, but there is no ill effect of not initializing the
variable in this case. 'rxq_interupt_offset' is irrelevant if
'rxq_interrupt_enable' is not set (the condition caught by coverity).

Fixes: fc2c8c0668fd ("net/enic: use Tx completion index instead of messages")
Coverity issue: 268314

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
 drivers/net/enic/enic_main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 822037ce8..2a2269794 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -200,15 +200,14 @@ void enic_init_vnic_resources(struct enic *enic)
 	unsigned int error_interrupt_enable = 1;
 	unsigned int error_interrupt_offset = 0;
 	unsigned int rxq_interrupt_enable = 0;
-	unsigned int rxq_interrupt_offset;
+	unsigned int rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET;
 	unsigned int index = 0;
 	unsigned int cq_idx;
 	struct vnic_rq *data_rq;
 
-	if (enic->rte_dev->data->dev_conf.intr_conf.rxq) {
+	if (enic->rte_dev->data->dev_conf.intr_conf.rxq)
 		rxq_interrupt_enable = 1;
-		rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET;
-	}
+
 	for (index = 0; index < enic->rq_count; index++) {
 		cq_idx = enic_cq_rq(enic, enic_rte_rq_idx_to_sop_idx(index));
 
-- 
2.16.2

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

* [dpdk-dev] [PATCH v2] net/enic: fix uninitialized variable
  2018-04-17 23:53 [dpdk-dev] [PATCH] net/enic: fix uninitialized variable John Daley
@ 2018-04-18  0:00 ` John Daley
  2018-04-18 17:09   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: John Daley @ 2018-04-18  0:00 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, John Daley

A local variable was used without initialization and triggered a
coverity issue.

Is is fixed here, but there is no ill effect of not initializing
the variable in this case. 'rxq_interrupt_offset' is irrelevant
if 'rxq_interrupt_enable' is not set (the condition caught by
coverity).

Fixes: fc2c8c0668fd ("net/enic: use Tx completion index instead of messages")
Coverity issue: 268314

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
v2: fix typo

 drivers/net/enic/enic_main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 822037ce8..2a2269794 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -200,15 +200,14 @@ void enic_init_vnic_resources(struct enic *enic)
 	unsigned int error_interrupt_enable = 1;
 	unsigned int error_interrupt_offset = 0;
 	unsigned int rxq_interrupt_enable = 0;
-	unsigned int rxq_interrupt_offset;
+	unsigned int rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET;
 	unsigned int index = 0;
 	unsigned int cq_idx;
 	struct vnic_rq *data_rq;
 
-	if (enic->rte_dev->data->dev_conf.intr_conf.rxq) {
+	if (enic->rte_dev->data->dev_conf.intr_conf.rxq)
 		rxq_interrupt_enable = 1;
-		rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET;
-	}
+
 	for (index = 0; index < enic->rq_count; index++) {
 		cq_idx = enic_cq_rq(enic, enic_rte_rq_idx_to_sop_idx(index));
 
-- 
2.16.2

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

* Re: [dpdk-dev] [PATCH v2] net/enic: fix uninitialized variable
  2018-04-18  0:00 ` [dpdk-dev] [PATCH v2] " John Daley
@ 2018-04-18 17:09   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-04-18 17:09 UTC (permalink / raw)
  To: John Daley; +Cc: dev

On 4/18/2018 1:00 AM, John Daley wrote:
> A local variable was used without initialization and triggered a
> coverity issue.
> 
> Is is fixed here, but there is no ill effect of not initializing
> the variable in this case. 'rxq_interrupt_offset' is irrelevant
> if 'rxq_interrupt_enable' is not set (the condition caught by
> coverity).
> 
> Fixes: fc2c8c0668fd ("net/enic: use Tx completion index instead of messages")
> Coverity issue: 268314
> 
> Signed-off-by: John Daley <johndale@cisco.com>
> Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-04-18 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 23:53 [dpdk-dev] [PATCH] net/enic: fix uninitialized variable John Daley
2018-04-18  0:00 ` [dpdk-dev] [PATCH v2] " John Daley
2018-04-18 17:09   ` Ferruh Yigit

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