DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix error definition type
@ 2021-10-27  2:01 Jie Wang
  2021-10-28 18:04 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Jie Wang @ 2021-10-27  2:01 UTC (permalink / raw)
  To: dev; +Cc: orika, Jie Wang

In "msg_type |= 0xc800", wider "51200" has high-order bits (0xc800)
that don't affect the narrower left-hand side.

This patch fixs coverity issue by changing the definition type of
"msg_type" from uint8_t to uint16_t.

Coverity issue: 373651
Fixes: 748530f0354e ("app/testpmd: support L2TPv2 and PPP protocol pattern")

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
 app/test-pmd/cmdline_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index d8218771fb..24b224e632 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -5880,7 +5880,7 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
 	struct rte_flow_item_l2tpv2 *l2tpv2_mask;
 	struct rte_flow_item *item;
 	uint32_t data_size;
-	uint8_t msg_type = 0;
+	uint16_t msg_type = 0;
 	struct buffer *out = buf;
 	const struct arg *arg;
 
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH] app/testpmd: fix error definition type
  2021-10-27  2:01 [dpdk-dev] [PATCH] app/testpmd: fix error definition type Jie Wang
@ 2021-10-28 18:04 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2021-10-28 18:04 UTC (permalink / raw)
  To: Jie Wang, dev; +Cc: orika

On 10/27/2021 3:01 AM, Jie Wang wrote:
> In "msg_type |= 0xc800", wider "51200" has high-order bits (0xc800)
> that don't affect the narrower left-hand side.
> 
> This patch fixs coverity issue by changing the definition type of
> "msg_type" from uint8_t to uint16_t.
> 
> Coverity issue: 373651
> Fixes: 748530f0354e ("app/testpmd: support L2TPv2 and PPP protocol pattern")
> 
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

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

end of thread, other threads:[~2021-10-28 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27  2:01 [dpdk-dev] [PATCH] app/testpmd: fix error definition type Jie Wang
2021-10-28 18:04 ` 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).