* [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference
@ 2016-06-13 9:35 Marcin Kerlin
2016-06-13 11:20 ` Dumitrescu, Cristian
0 siblings, 1 reply; 3+ messages in thread
From: Marcin Kerlin @ 2016-06-13 9:35 UTC (permalink / raw)
To: dev; +Cc: piotrx.t.azarewicz, cristian.dumitrescu, Marcin Kerlin
Return value of function app_pipeline_type_find is not checking before
dereference. Fix this problem by adding checking condition.
Coverity issue: 127196
Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding dynamically")
Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
---
examples/ip_pipeline/thread_fe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/examples/ip_pipeline/thread_fe.c b/examples/ip_pipeline/thread_fe.c
index d1b72b4..6c547ca 100644
--- a/examples/ip_pipeline/thread_fe.c
+++ b/examples/ip_pipeline/thread_fe.c
@@ -81,6 +81,9 @@ app_pipeline_enable(struct app_params *app,
p_params = &app->pipeline_params[pipeline_id];
p_type = app_pipeline_type_find(app, p_params->type);
+ if (p_type == NULL)
+ return -1;
+
if (p->enabled == 1)
return -1;
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference
2016-06-13 9:35 [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference Marcin Kerlin
@ 2016-06-13 11:20 ` Dumitrescu, Cristian
2016-06-14 19:10 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Dumitrescu, Cristian @ 2016-06-13 11:20 UTC (permalink / raw)
To: Kerlin, MarcinX, dev; +Cc: Azarewicz, PiotrX T
> -----Original Message-----
> From: Kerlin, MarcinX
> Sent: Monday, June 13, 2016 10:36 AM
> To: dev@dpdk.org
> Cc: Azarewicz, PiotrX T <piotrx.t.azarewicz@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; Kerlin, MarcinX
> <marcinx.kerlin@intel.com>
> Subject: [PATCH 1/1] ip_pipeline: fix null pointer dereference
>
> Return value of function app_pipeline_type_find is not checking before
> dereference. Fix this problem by adding checking condition.
>
> Coverity issue: 127196
> Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
> dynamically")
>
> Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
> ---
> examples/ip_pipeline/thread_fe.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/examples/ip_pipeline/thread_fe.c
> b/examples/ip_pipeline/thread_fe.c
> index d1b72b4..6c547ca 100644
> --- a/examples/ip_pipeline/thread_fe.c
> +++ b/examples/ip_pipeline/thread_fe.c
> @@ -81,6 +81,9 @@ app_pipeline_enable(struct app_params *app,
> p_params = &app->pipeline_params[pipeline_id];
> p_type = app_pipeline_type_find(app, p_params->type);
>
> + if (p_type == NULL)
> + return -1;
> +
> if (p->enabled == 1)
> return -1;
>
> --
> 1.9.1
Hi Marcin,
Checking p_type at this point is not required, as we already validated the pipeline settings (including the pipeline type) as part of the init code.
But since this code is harmless I am acking this patch just to avoid having the same discussion about this Coverity false positive issue again.
Regards,
Cristian
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference
2016-06-13 11:20 ` Dumitrescu, Cristian
@ 2016-06-14 19:10 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2016-06-14 19:10 UTC (permalink / raw)
To: Kerlin, MarcinX; +Cc: dev, Dumitrescu, Cristian, Azarewicz, PiotrX T
> > Return value of function app_pipeline_type_find is not checking before
> > dereference. Fix this problem by adding checking condition.
> >
> > Coverity issue: 127196
> > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding
> > dynamically")
> >
> > Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
> Hi Marcin,
>
> Checking p_type at this point is not required, as we already validated the pipeline settings (including the pipeline type) as part of the init code.
>
> But since this code is harmless I am acking this patch just to avoid having the same discussion about this Coverity false positive issue again.
>
> Regards,
> Cristian
>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-14 19:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 9:35 [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference Marcin Kerlin
2016-06-13 11:20 ` Dumitrescu, Cristian
2016-06-14 19:10 ` 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).