DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeneontx: fix warnings
@ 2018-04-05 15:12 Stephen Hemminger
  2018-04-06  6:55 ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2018-04-05 15:12 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, Stephen Hemminger

This is fix for Coverity Devect 268319 about uninitialized speed
in an error case. Also drop unnecessary assignment.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeontx/octeontx_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 90dd249a6b84..ec3438cb1941 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -518,7 +518,6 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
 	struct rte_eth_link link;
 	int res;
 
-	res = 0;
 	PMD_INIT_FUNC_TRACE();
 
 	res = octeontx_port_link_status(nic);
@@ -552,6 +551,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
 	case OCTEONTX_LINK_SPEED_RESERVE1:
 	case OCTEONTX_LINK_SPEED_RESERVE2:
 	default:
+		link.link_speed = ETH_SPEED_NUM_NONE;
 		octeontx_log_err("incorrect link speed %d", nic->speed);
 		break;
 	}
-- 
2.16.3

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

* Re: [dpdk-dev] [PATCH] net/octeneontx: fix warnings
  2018-04-05 15:12 [dpdk-dev] [PATCH] net/octeneontx: fix warnings Stephen Hemminger
@ 2018-04-06  6:55 ` Jerin Jacob
  2018-04-06  9:42   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2018-04-06  6:55 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

-----Original Message-----
> Date: Thu,  5 Apr 2018 08:12:28 -0700
> From: Stephen Hemminger <stephen@networkplumber.org>
> To: jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
> Subject: [PATCH] net/octeneontx: fix warnings
> X-Mailer: git-send-email 2.16.3
> 
> This is fix for Coverity Devect 268319 about uninitialized speed

s/Devect/defect

> in an error case. Also drop unnecessary assignment.

Coverity issue: 268319
Fixes: 4fac7c0a147e ("net/octeontx: add link update")

CC: stable@dpdk.org

with above changes in the commit log:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/net/octeontx/octeontx_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
> index 90dd249a6b84..ec3438cb1941 100644
> --- a/drivers/net/octeontx/octeontx_ethdev.c
> +++ b/drivers/net/octeontx/octeontx_ethdev.c
> @@ -518,7 +518,6 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
>  	struct rte_eth_link link;
>  	int res;
>  
> -	res = 0;
>  	PMD_INIT_FUNC_TRACE();
>  
>  	res = octeontx_port_link_status(nic);
> @@ -552,6 +551,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev,
>  	case OCTEONTX_LINK_SPEED_RESERVE1:
>  	case OCTEONTX_LINK_SPEED_RESERVE2:
>  	default:
> +		link.link_speed = ETH_SPEED_NUM_NONE;
>  		octeontx_log_err("incorrect link speed %d", nic->speed);
>  		break;
>  	}
> -- 
> 2.16.3
> 

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

* Re: [dpdk-dev] [PATCH] net/octeneontx: fix warnings
  2018-04-06  6:55 ` Jerin Jacob
@ 2018-04-06  9:42   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-04-06  9:42 UTC (permalink / raw)
  To: Jerin Jacob, Stephen Hemminger; +Cc: dev

On 4/6/2018 7:55 AM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Thu,  5 Apr 2018 08:12:28 -0700
>> From: Stephen Hemminger <stephen@networkplumber.org>
>> To: jerin.jacob@caviumnetworks.com
>> Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
>> Subject: [PATCH] net/octeneontx: fix warnings
>> X-Mailer: git-send-email 2.16.3
>>
>> This is fix for Coverity Devect 268319 about uninitialized speed
> 
> s/Devect/defect
> 
>> in an error case. Also drop unnecessary assignment.
> 
> Coverity issue: 268319
> Fixes: 4fac7c0a147e ("net/octeontx: add link update")
> 
> CC: stable@dpdk.org
> 

>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

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

(with suggested commit log updates)

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

end of thread, other threads:[~2018-04-06  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 15:12 [dpdk-dev] [PATCH] net/octeneontx: fix warnings Stephen Hemminger
2018-04-06  6:55 ` Jerin Jacob
2018-04-06  9:42   ` 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).