Message ID | 1461936960-8736-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Accepted |
Commit | 151582a386fe659f8fcd825e4d7380fd992392ff |
Headers | show |
On 29 April 2016 at 09:36, Bill Fischofer <bill.fischofer@linaro.org> wrote: > Free all entries in name table during odp_term_global() to avoid > memory leaks. > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > Reviewed-and-tested-by Mike Holmes <Mike.holmes@linaro.org> > --- > platform/linux-generic/odp_name_table.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/platform/linux-generic/odp_name_table.c > b/platform/linux-generic/odp_name_table.c > index 1e43a2c..801c456 100644 > --- a/platform/linux-generic/odp_name_table.c > +++ b/platform/linux-generic/odp_name_table.c > @@ -1202,5 +1202,11 @@ int _odp_int_name_tbl_init_global(void) > > int _odp_int_name_tbl_term_global(void) > { > + int i; > + > + for (i = 0; i < name_tbls.num_name_tbls; i++) > + aligned_free(name_tbls.tbls[i]); > + > + name_tbls_initialized = 0; > return 0; > } > -- > 2.5.0 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp > -- Mike Holmes Technical Manager - Linaro Networking Group Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs "Work should be fun and collaborative, the rest follows"
Merged, Maxim. On 04/29/16 21:29, Mike Holmes wrote: > > > On 29 April 2016 at 09:36, Bill Fischofer <bill.fischofer@linaro.org > <mailto:bill.fischofer@linaro.org>> wrote: > > Free all entries in name table during odp_term_global() to avoid > memory leaks. > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org > <mailto:bill.fischofer@linaro.org>> > > > Reviewed-and-tested-by Mike Holmes <Mike.holmes@linaro.org > <mailto:Mike.holmes@linaro.org>> > > --- > platform/linux-generic/odp_name_table.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/platform/linux-generic/odp_name_table.c > b/platform/linux-generic/odp_name_table.c > index 1e43a2c..801c456 100644 > --- a/platform/linux-generic/odp_name_table.c > +++ b/platform/linux-generic/odp_name_table.c > @@ -1202,5 +1202,11 @@ int _odp_int_name_tbl_init_global(void) > > int _odp_int_name_tbl_term_global(void) > { > + int i; > + > + for (i = 0; i < name_tbls.num_name_tbls; i++) > + aligned_free(name_tbls.tbls[i]); > + > + name_tbls_initialized = 0; > return 0; > } > -- > 2.5.0 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > https://lists.linaro.org/mailman/listinfo/lng-odp > > > > > -- > Mike Holmes > Technical Manager - Linaro Networking Group > Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs > "Work should be fun and collaborative, the rest follows" > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/platform/linux-generic/odp_name_table.c b/platform/linux-generic/odp_name_table.c index 1e43a2c..801c456 100644 --- a/platform/linux-generic/odp_name_table.c +++ b/platform/linux-generic/odp_name_table.c @@ -1202,5 +1202,11 @@ int _odp_int_name_tbl_init_global(void) int _odp_int_name_tbl_term_global(void) { + int i; + + for (i = 0; i < name_tbls.num_name_tbls; i++) + aligned_free(name_tbls.tbls[i]); + + name_tbls_initialized = 0; return 0; }
Free all entries in name table during odp_term_global() to avoid memory leaks. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/odp_name_table.c | 6 ++++++ 1 file changed, 6 insertions(+)