lkml.org 
[lkml]   [2016]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] irqchip: gicv3-its: Fix memory leak in its_free_tables()
On Thu, 28 Jan 2016, Shanker Donthineni wrote:
> @@ -807,9 +810,10 @@ static void its_free_tables(struct its_node *its)
> int i;
>
> for (i = 0; i < GITS_BASER_NR_REGS; i++) {
> - if (its->tables[i]) {
> - free_page((unsigned long)its->tables[i]);
> - its->tables[i] = NULL;
> + if (its->tables[i].base) {
> + free_pages((unsigned long)its->tables[i].base,
> + get_order(its->tables[i].size));
> + its->tables[i].base = NULL;
> }
> }
> }
> @@ -880,6 +884,7 @@ retry_alloc_baser:
> if (alloc_pages > GITS_BASER_PAGES_MAX) {
> alloc_pages = GITS_BASER_PAGES_MAX;
> order = get_order(GITS_BASER_PAGES_MAX * psz);
> + alloc_size = (1 << order) * PAGE_SIZE;

Why don't you record the order instead of converting back and forth ?

Thanks,

tglx

\
 
 \ /
  Last update: 2016-01-29 10:01    [W:0.162 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site