linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Jacky(GuangXiang Lee)" <gxli@arca.com.cn>
To: linux-mm@kvack.org
Subject: probably memory leak in sparse_index_init()? ---2.6.23/mm/sparse.c
Date: Wed, 14 Nov 2007 12:24:23 +0800	[thread overview]
Message-ID: <473A7877.90703@arca.com.cn> (raw)

hi,
As following,after allocing ,then go out at finding mem_section not
null.sure?


static int __meminit sparse_index_init(unsigned long section_nr, int nid)
{
static DEFINE_SPINLOCK(index_init_lock);
unsigned long root = SECTION_NR_TO_ROOT(section_nr);
struct mem_section *section;
int ret = 0;

if (mem_section[root])
return -EEXIST;

section = sparse_index_alloc(nid);
/*
* This lock keeps two different sections from
* reallocating for the same index
*/
spin_lock(&index_init_lock);

if (mem_section[root]) {
ret = -EEXIST;
goto out;
}

mem_section[root] = section;
out:
spin_unlock(&index_init_lock);
return ret;
}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2007-11-14  4:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=473A7877.90703@arca.com.cn \
    --to=gxli@arca.com.cn \
    --cc=linux-mm@kvack.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