Skip to contentSkip to conversation

probably memory leak in sparse_index_init()? ---2.6.23/mm/sparse.c

DISCUSSION Jacky(GuangXiang Lee) 1 participant 1 message Nov 14, 2007 Memory management

lore
Share & tools
lore
#0 lore 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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>