From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] irqchip: gicv3-its: Fix memory leak in its_free_tables()
Date: Fri, 29 Jan 2016 09:30:41 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1601290930000.3886@nanos> (raw)
In-Reply-To: <1454042578-13933-1-git-send-email-shankerd@codeaurora.org>
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
next prev parent reply other threads:[~2016-01-29 8:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 4:42 [PATCH v2] irqchip: gicv3-its: Fix memory leak in its_free_tables() Shanker Donthineni
2016-01-29 8:30 ` Thomas Gleixner [this message]
2016-01-30 1:13 ` Shanker Donthineni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1601290930000.3886@nanos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox