Message ID | 1408997188-22253-1-git-send-email-anders.roxell@linaro.org |
---|---|
State | New |
Headers | show |
On 2014-08-25 22:06, Anders Roxell wrote: > Signed-off-by: Anders Roxell <anders.roxell@linaro.org> > --- > platform/linux-dpdk/odp_linux.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/platform/linux-dpdk/odp_linux.c b/platform/linux-dpdk/odp_linux.c > index 067bd99..a694f65 100644 > --- a/platform/linux-dpdk/odp_linux.c > +++ b/platform/linux-dpdk/odp_linux.c > @@ -78,6 +78,7 @@ void odp_linux_pthread_create(odp_linux_pthread_t *thread_tbl, int num, > odp_run_start_routine(start_args); > lcore_config[cpu].state = FINISHED; > } > + free(start_args); > } > } > > -- > 1.9.1 > Ping.
On 28 August 2014 12:24, Anders Roxell <anders.roxell@linaro.org> wrote: > On 2014-08-25 22:06, Anders Roxell wrote: > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org> > > --- > > platform/linux-dpdk/odp_linux.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/platform/linux-dpdk/odp_linux.c > b/platform/linux-dpdk/odp_linux.c > > index 067bd99..a694f65 100644 > > --- a/platform/linux-dpdk/odp_linux.c > > +++ b/platform/linux-dpdk/odp_linux.c > > @@ -78,6 +78,7 @@ void odp_linux_pthread_create(odp_linux_pthread_t > *thread_tbl, int num, > > odp_run_start_routine(start_args); > > lcore_config[cpu].state = FINISHED; > > } > > + free(start_args); > No, this should not be done. start_args gets dereferenced in the function given to pthread. Freeing it here will cause a crash. For eg., thr_args->dstpktio is done in pktio_ifburst_thread function of odp_l2fwd.c. > > } > > } > > > > -- > > 1.9.1 > > > > Ping. > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 08/28/2014 10:54 AM, Anders Roxell wrote: > On 2014-08-25 22:06, Anders Roxell wrote: >> Signed-off-by: Anders Roxell <anders.roxell@linaro.org> >> --- >> platform/linux-dpdk/odp_linux.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/platform/linux-dpdk/odp_linux.c b/platform/linux-dpdk/odp_linux.c >> index 067bd99..a694f65 100644 >> --- a/platform/linux-dpdk/odp_linux.c >> +++ b/platform/linux-dpdk/odp_linux.c >> @@ -78,6 +78,7 @@ void odp_linux_pthread_create(odp_linux_pthread_t *thread_tbl, int num, >> odp_run_start_routine(start_args); >> lcore_config[cpu].state = FINISHED; >> } >> + free(start_args); >> } >> } >> >> -- >> 1.9.1 >> > Ping. it's dangerous to do so. free should be in odp_run_start_routine(void *arg) or even in dpdk version of odp_linux_pthread_join(). You can free before odp_run_start_routine() parses arguments. Thanks, Maxim. > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/platform/linux-dpdk/odp_linux.c b/platform/linux-dpdk/odp_linux.c index 067bd99..a694f65 100644 --- a/platform/linux-dpdk/odp_linux.c +++ b/platform/linux-dpdk/odp_linux.c @@ -78,6 +78,7 @@ void odp_linux_pthread_create(odp_linux_pthread_t *thread_tbl, int num, odp_run_start_routine(start_args); lcore_config[cpu].state = FINISHED; } + free(start_args); } }
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> --- platform/linux-dpdk/odp_linux.c | 1 + 1 file changed, 1 insertion(+)