linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, benh@kernel.crashing.org
Subject: Re: [PATCH] powerpc/rtas_flash: Free kmem upon module exit
Date: Wed, 20 Feb 2013 15:02:29 +0530	[thread overview]
Message-ID: <5124982D.1090504@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130208111742.31083.67858.stgit@hegdevasant.in.ibm.com>

Ben,

	Let me know your thoughts on this patch.

-Vasant


On 02/08/2013 04:48 PM, Vasant Hegde wrote:
> Memory allocated to rtas_firmware_flash_list in rtas_flash_write
> is not freed during module exit. We hit below call trace if we
> unload rtas_flash module after loading new firmware image and
> before rebooting the system.
>
> Call trace:
> ----------
> Feb  6 08:42:10 eagle3 kernel: kmem_cache_destroy rtas_flash_cache: Slab cache still has objects
> Feb  6 08:42:10 eagle3 kernel: Call Trace:
> Feb  6 08:42:10 eagle3 kernel: [c00000001c303b40] [c000000000014940] .show_stack+0x70/0x1c0 (unreliable)
> Feb  6 08:42:10 eagle3 kernel: [c00000001c303bf0] [c000000000199bec] .kmem_cache_destroy+0x15c/0x170
> Feb  6 08:42:10 eagle3 kernel: [c00000001c303c90] [d000000006fa1208] .rtas_flash_cleanup+0x3c/0x80 [rtas_flash]
> Feb  6 08:42:10 eagle3 kernel: [c00000001c303d20] [c0000000000f8970] .SyS_delete_module+0x1d0/0x2e0
> Feb  6 08:42:10 eagle3 kernel: [c00000001c303e30] [c000000000009954] syscall_exit+0x0/0x94
>
> This patch frees rtas_firmware_flash_list during module exit.
>
> Signed-off-by: Vasant Hegde<hegdevasant@linux.vnet.ibm.com>
> ---
>   arch/powerpc/kernel/rtas_flash.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
> index 8329190..e22ef34 100644
> --- a/arch/powerpc/kernel/rtas_flash.c
> +++ b/arch/powerpc/kernel/rtas_flash.c
> @@ -790,6 +790,11 @@ static void __exit rtas_flash_cleanup(void)
>   {
>   	rtas_flash_term_hook = NULL;
>
> +	if (rtas_firmware_flash_list) {
> +		free_flash_list(rtas_firmware_flash_list);
> +		rtas_firmware_flash_list = NULL;
> +	}
> +
>   	if (flash_block_cache)
>   		kmem_cache_destroy(flash_block_cache);
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>

      reply	other threads:[~2013-02-20  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 11:18 [PATCH] powerpc/rtas_flash: Free kmem upon module exit Vasant Hegde
2013-02-20  9:32 ` Vasant Hegde [this message]

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=5124982D.1090504@linux.vnet.ibm.com \
    --to=hegdevasant@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).