DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings
@ 2015-12-10  9:50 Remy Horton
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable Remy Horton
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Remy Horton @ 2015-12-10  9:50 UTC (permalink / raw)
  To: dev

Remy Horton (2):
  examples/ethtool: Fix uninitialised variable in structure
  examples/l2fwd-keepalive: Fix integer overflow

 examples/ethtool/ethtool-app/ethapp.c | 3 +++
 examples/l2fwd-keepalive/main.c       | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

-- 
1.9.3

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

* [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable
  2015-12-10  9:50 [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings Remy Horton
@ 2015-12-10  9:50 ` Remy Horton
  2015-12-10 10:20   ` Mcnamara, John
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow Remy Horton
  2015-12-10 21:27 ` [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Remy Horton @ 2015-12-10  9:50 UTC (permalink / raw)
  To: dev

Fix Coverity warning with uninitialised field in structure being used.
Zero out all the other unused ones.

>>> CID 120413 (#1 of 1): Uninitialized scalar variable (UNINIT)

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 examples/ethtool/ethtool-app/ethapp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
index 3863b02..2ed4796 100644
--- a/examples/ethtool/ethtool-app/ethapp.c
+++ b/examples/ethtool/ethtool-app/ethapp.c
@@ -339,6 +339,7 @@ pcmd_pause_callback(void *ptr_params,
 	if (ptr_data != NULL) {
 		stat = rte_ethtool_get_pauseparam(params->port, &info);
 	} else {
+		memset(&info, 0, sizeof(info));
 		if (strcasecmp("all", params->opt) == 0) {
 			info.tx_pause = 1;
 			info.rx_pause = 1;
@@ -352,6 +353,8 @@ pcmd_pause_callback(void *ptr_params,
 			info.tx_pause = 0;
 			info.rx_pause = 0;
 		}
+		/* Assume auto-negotiation wanted */
+		info.autoneg = 1;
 		stat = rte_ethtool_set_pauseparam(params->port, &info);
 	}
 	if (stat == 0) {
-- 
1.9.3

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

* [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow
  2015-12-10  9:50 [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings Remy Horton
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable Remy Horton
@ 2015-12-10  9:50 ` Remy Horton
  2015-12-10 10:20   ` Mcnamara, John
  2015-12-10 21:27 ` [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Remy Horton @ 2015-12-10  9:50 UTC (permalink / raw)
  To: dev

Fix Coverity warning with potential 32-bit integer multiplication overflow
where final result is expected to be 64-bit.

>>> CID 120144 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 examples/l2fwd-keepalive/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 8d7b09e..f4d52f2 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -471,7 +471,7 @@ l2fwd_parse_args(int argc, char **argv)
 		/* timer period */
 		case 'T':
 			timer_period = l2fwd_parse_timer_period(optarg)
-				* 1000 * TIMER_MILLISECOND;
+				* (int64_t)(1000 * TIMER_MILLISECOND);
 			if (timer_period < 0) {
 				printf("invalid timer period\n");
 				l2fwd_usage(prgname);
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable Remy Horton
@ 2015-12-10 10:20   ` Mcnamara, John
  0 siblings, 0 replies; 6+ messages in thread
From: Mcnamara, John @ 2015-12-10 10:20 UTC (permalink / raw)
  To: Horton, Remy, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton
> Sent: Thursday, December 10, 2015 9:50 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised
> variable
> 
> Fix Coverity warning with uninitialised field in structure being used.
> Zero out all the other unused ones.
> 
> >>> CID 120413 (#1 of 1): Uninitialized scalar variable (UNINIT)
> 
> Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample
> application")
> 
> Signed-off-by: Remy Horton <remy.horton@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

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

* Re: [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow Remy Horton
@ 2015-12-10 10:20   ` Mcnamara, John
  0 siblings, 0 replies; 6+ messages in thread
From: Mcnamara, John @ 2015-12-10 10:20 UTC (permalink / raw)
  To: Horton, Remy, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton
> Sent: Thursday, December 10, 2015 9:50 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer
> overflow
> 
> Fix Coverity warning with potential 32-bit integer multiplication overflow
> where final result is expected to be 64-bit.
> 
> >>> CID 120144 (#1 of 1): Unintentional integer overflow
> >>> (OVERFLOW_BEFORE_WIDEN)
> 
> Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
> 
> Signed-off-by: Remy Horton <remy.horton@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

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

* Re: [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings
  2015-12-10  9:50 [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings Remy Horton
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable Remy Horton
  2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow Remy Horton
@ 2015-12-10 21:27 ` Thomas Monjalon
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-12-10 21:27 UTC (permalink / raw)
  To: Remy Horton; +Cc: dev

2015-12-10 09:50, Remy Horton:
> Remy Horton (2):
>   examples/ethtool: Fix uninitialised variable in structure
>   examples/l2fwd-keepalive: Fix integer overflow

Applied, thanks

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

end of thread, other threads:[~2015-12-10 21:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10  9:50 [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings Remy Horton
2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised variable Remy Horton
2015-12-10 10:20   ` Mcnamara, John
2015-12-10  9:50 ` [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow Remy Horton
2015-12-10 10:20   ` Mcnamara, John
2015-12-10 21:27 ` [dpdk-dev] [PATCH v1 0/2] Fix various Coverity warnings 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).