All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
@ 2015-12-08 14:16 Piotr Azarewicz
  2015-12-08 14:47 ` Mcnamara, John
  2015-12-09  9:33 ` [PATCH v2 " Piotr Azarewicz
  0 siblings, 2 replies; 7+ messages in thread
From: Piotr Azarewicz @ 2015-12-08 14:16 UTC (permalink / raw)
  To: dev

The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t.
So the goal is to copy elements size of cmdline_parse_ctx_t not
cmdline_parse_ctx_t*.

Coverity issue: 120412
Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
dynamically")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---
 examples/ip_pipeline/thread_fe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ip_pipeline/thread_fe.c b/examples/ip_pipeline/thread_fe.c
index 7a3bbf8..f1df05e 100644
--- a/examples/ip_pipeline/thread_fe.c
+++ b/examples/ip_pipeline/thread_fe.c
@@ -337,7 +337,7 @@ app_pipeline_thread_cmd_push(struct app_params *app)
 	/* Push thread commands into the application */
 	memcpy(&app->cmds[app->n_cmds],
 			thread_cmds,
-		n_cmds * sizeof(cmdline_parse_ctx_t *));
+		n_cmds * sizeof(cmdline_parse_ctx_t));
 
 	for (i = 0; i < n_cmds; i++)
 		app->cmds[app->n_cmds + i]->data = app;
-- 
1.7.9.5

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

* Re: [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
  2015-12-08 14:16 [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue Piotr Azarewicz
@ 2015-12-08 14:47 ` Mcnamara, John
  2015-12-08 16:59   ` Mcnamara, John
  2015-12-09  9:33 ` [PATCH v2 " Piotr Azarewicz
  1 sibling, 1 reply; 7+ messages in thread
From: Mcnamara, John @ 2015-12-08 14:47 UTC (permalink / raw)
  To: Azarewicz, PiotrX T, dev@dpdk.org

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> Sent: Tuesday, December 8, 2015 2:17 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
> 
> The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t.
> So the goal is to copy elements size of cmdline_parse_ctx_t not
> cmdline_parse_ctx_t*.
> 
> Coverity issue: 120412
> Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
> dynamically")
> 
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>

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

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

* Re: [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
  2015-12-08 14:47 ` Mcnamara, John
@ 2015-12-08 16:59   ` Mcnamara, John
  2015-12-09  8:35     ` Azarewicz, PiotrX T
  0 siblings, 1 reply; 7+ messages in thread
From: Mcnamara, John @ 2015-12-08 16:59 UTC (permalink / raw)
  To: Mcnamara, John, Azarewicz, PiotrX T, dev@dpdk.org

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
> Sent: Tuesday, December 8, 2015 2:47 PM
> To: Azarewicz, PiotrX T; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy
> issue
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> > Sent: Tuesday, December 8, 2015 2:17 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy
> > issue
> >
> > The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t.
> > So the goal is to copy elements size of cmdline_parse_ctx_t not
> > cmdline_parse_ctx_t*.
> >
> > Coverity issue: 120412
> > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
> > dynamically")
> >
> > Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> 
> Acked-by: John McNamara <john.mcnamara@intel.com>

Hi Piotr,

This issue occurs copy and pasted in two other locations as well:

    examples/ip_pipeline/pipeline/pipeline_common_fe.c
    1295:           n_cmds * sizeof(cmdline_parse_ctx_t *));

    examples/ip_pipeline/thread_fe.c
    340:            n_cmds * sizeof(cmdline_parse_ctx_t *));

    examples/ip_pipeline/init.c
    1475:           n_cmds * sizeof(cmdline_parse_ctx_t *));

Perhaps you could fix those in the same patch.

Thanks,

John

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

* Re: [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
  2015-12-08 16:59   ` Mcnamara, John
@ 2015-12-09  8:35     ` Azarewicz, PiotrX T
  0 siblings, 0 replies; 7+ messages in thread
From: Azarewicz, PiotrX T @ 2015-12-09  8:35 UTC (permalink / raw)
  To: Mcnamara, John, dev@dpdk.org

> -----Original Message-----
> From: Mcnamara, John
> Sent: Tuesday, December 8, 2015 6:00 PM
> To: Mcnamara, John <john.mcnamara@intel.com>; Azarewicz, PiotrX T
> <piotrx.t.azarewicz@intel.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy
> issue
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
> > Sent: Tuesday, December 8, 2015 2:47 PM
> > To: Azarewicz, PiotrX T; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy
> > issue
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> > > Sent: Tuesday, December 8, 2015 2:17 PM
> > > To: dev@dpdk.org
> > > Subject: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy
> > > issue
> > >
> > > The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t.
> > > So the goal is to copy elements size of cmdline_parse_ctx_t not
> > > cmdline_parse_ctx_t*.
> > >
> > > Coverity issue: 120412
> > > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread
> > > binding
> > > dynamically")
> > >
> > > Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> >
> > Acked-by: John McNamara <john.mcnamara@intel.com>
> 
> Hi Piotr,
> 
> This issue occurs copy and pasted in two other locations as well:
> 
>     examples/ip_pipeline/pipeline/pipeline_common_fe.c
>     1295:           n_cmds * sizeof(cmdline_parse_ctx_t *));
> 
>     examples/ip_pipeline/thread_fe.c
>     340:            n_cmds * sizeof(cmdline_parse_ctx_t *));
> 
>     examples/ip_pipeline/init.c
>     1475:           n_cmds * sizeof(cmdline_parse_ctx_t *));
> 
> Perhaps you could fix those in the same patch.
> 
> Thanks,
> 
> John
> 
> 

Yes, you are right, thanks. I will send v2.

Piotr

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

* [PATCH v2 1/1] example/ip_pipeline: fix memcpy issue
  2015-12-08 14:16 [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue Piotr Azarewicz
  2015-12-08 14:47 ` Mcnamara, John
@ 2015-12-09  9:33 ` Piotr Azarewicz
  2015-12-09 10:51   ` Mcnamara, John
  1 sibling, 1 reply; 7+ messages in thread
From: Piotr Azarewicz @ 2015-12-09  9:33 UTC (permalink / raw)
  To: dev

The source and destination both are the arrays of cmdline_parse_ctx_t.
So the goal is to copy elements size of cmdline_parse_ctx_t not
cmdline_parse_ctx_t*.

Coverity issue: 120412
Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
dynamically")

Fixes: ea0908c4ab89 ("examples/ip_pipeline: add master pipeline")
Fixes: eb32fe7c5574 ("examples/ip_pipeline: rework initialization parameters")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---

v2 changes:
- add the same fix in two other places

 examples/ip_pipeline/init.c                        |    2 +-
 examples/ip_pipeline/pipeline/pipeline_common_fe.c |    2 +-
 examples/ip_pipeline/thread_fe.c                   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 52aab53..bc6d6d9 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -1472,7 +1472,7 @@ app_pipeline_type_cmd_push(struct app_params *app,
 	/* Push pipeline commands into the application */
 	memcpy(&app->cmds[app->n_cmds],
 		cmds,
-		n_cmds * sizeof(cmdline_parse_ctx_t *));
+		n_cmds * sizeof(cmdline_parse_ctx_t));
 
 	for (i = 0; i < n_cmds; i++)
 		app->cmds[app->n_cmds + i]->data = app;
diff --git a/examples/ip_pipeline/pipeline/pipeline_common_fe.c b/examples/ip_pipeline/pipeline/pipeline_common_fe.c
index 87ec164..1e16ad6 100644
--- a/examples/ip_pipeline/pipeline/pipeline_common_fe.c
+++ b/examples/ip_pipeline/pipeline/pipeline_common_fe.c
@@ -1292,7 +1292,7 @@ app_pipeline_common_cmd_push(struct app_params *app)
 	/* Push pipeline commands into the application */
 	memcpy(&app->cmds[app->n_cmds],
 		pipeline_common_cmds,
-		n_cmds * sizeof(cmdline_parse_ctx_t *));
+		n_cmds * sizeof(cmdline_parse_ctx_t));
 
 	for (i = 0; i < n_cmds; i++)
 		app->cmds[app->n_cmds + i]->data = app;
diff --git a/examples/ip_pipeline/thread_fe.c b/examples/ip_pipeline/thread_fe.c
index 7a3bbf8..f1df05e 100644
--- a/examples/ip_pipeline/thread_fe.c
+++ b/examples/ip_pipeline/thread_fe.c
@@ -337,7 +337,7 @@ app_pipeline_thread_cmd_push(struct app_params *app)
 	/* Push thread commands into the application */
 	memcpy(&app->cmds[app->n_cmds],
 			thread_cmds,
-		n_cmds * sizeof(cmdline_parse_ctx_t *));
+		n_cmds * sizeof(cmdline_parse_ctx_t));
 
 	for (i = 0; i < n_cmds; i++)
 		app->cmds[app->n_cmds + i]->data = app;
-- 
1.7.9.5

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

* Re: [PATCH v2 1/1] example/ip_pipeline: fix memcpy issue
  2015-12-09  9:33 ` [PATCH v2 " Piotr Azarewicz
@ 2015-12-09 10:51   ` Mcnamara, John
  2015-12-09 20:48     ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Mcnamara, John @ 2015-12-09 10:51 UTC (permalink / raw)
  To: Azarewicz, PiotrX T, dev@dpdk.org

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> Sent: Wednesday, December 9, 2015 9:34 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 1/1] example/ip_pipeline: fix memcpy issue
> 
> The source and destination both are the arrays of cmdline_parse_ctx_t.
> So the goal is to copy elements size of cmdline_parse_ctx_t not
> cmdline_parse_ctx_t*.
> 
> Coverity issue: 120412
> Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
> dynamically")
> 
> Fixes: ea0908c4ab89 ("examples/ip_pipeline: add master pipeline")
> Fixes: eb32fe7c5574 ("examples/ip_pipeline: rework initialization
> parameters")
> 
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>

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

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

* Re: [PATCH v2 1/1] example/ip_pipeline: fix memcpy issue
  2015-12-09 10:51   ` Mcnamara, John
@ 2015-12-09 20:48     ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2015-12-09 20:48 UTC (permalink / raw)
  To: Azarewicz, PiotrX T; +Cc: dev

> > The source and destination both are the arrays of cmdline_parse_ctx_t.
> > So the goal is to copy elements size of cmdline_parse_ctx_t not
> > cmdline_parse_ctx_t*.
> > 
> > Coverity issue: 120412
> > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
> > dynamically")
> > 
> > Fixes: ea0908c4ab89 ("examples/ip_pipeline: add master pipeline")
> > Fixes: eb32fe7c5574 ("examples/ip_pipeline: rework initialization
> > parameters")
> > 
> > Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> 
> Acked-by: John McNamara <john.mcnamara@intel.com>

Applied (and merged with Stephen's patch), thanks

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

end of thread, other threads:[~2015-12-09 20:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08 14:16 [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue Piotr Azarewicz
2015-12-08 14:47 ` Mcnamara, John
2015-12-08 16:59   ` Mcnamara, John
2015-12-09  8:35     ` Azarewicz, PiotrX T
2015-12-09  9:33 ` [PATCH v2 " Piotr Azarewicz
2015-12-09 10:51   ` Mcnamara, John
2015-12-09 20:48     ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.