+ sparsemem-sparse_add_one_section-may-fail-to-allocate-memory.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     sparsemem: sparse_add_one_section() may fail to allocate memory
has been added to the -mm tree.  Its filename is
     sparsemem-sparse_add_one_section-may-fail-to-allocate-memory.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: sparsemem: sparse_add_one_section() may fail to allocate memory
From: Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx>

FIXME There are still some possible memory leaks in sparse_add_one_section():
  - usemap is never deallocated
  - __kfree_section_memmap() is a not yet implemented dummy

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@xxxxxxxxxxx>
Cc: Milton Miller <miltonm@xxxxxxx>
Cc: Geoff Levand <geoffrey.levand@xxxxxxxxxxx>
Cc: Christoph Lameter <clameter@xxxxxxx>
Cc: Andy Whitcroft <apw@xxxxxxxxxxxx>
Cc: Yasunori Goto <y-goto@xxxxxxxxxxxxxx>
Cc: Dave Hansen <haveblue@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/sparse.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN mm/sparse.c~sparsemem-sparse_add_one_section-may-fail-to-allocate-memory mm/sparse.c
--- a/mm/sparse.c~sparsemem-sparse_add_one_section-may-fail-to-allocate-memory
+++ a/mm/sparse.c
@@ -391,6 +391,9 @@ int sparse_add_one_section(struct zone *
 	 */
 	sparse_index_init(section_nr, pgdat->node_id);
 	memmap = kmalloc_section_memmap(section_nr, pgdat->node_id, nr_pages);
+	if (!memmap)
+		return -ENOMEM;
+
 	usemap = __kmalloc_section_usemap();
 
 	pgdat_resize_lock(pgdat, &flags);
_

Patches currently in -mm which might be from Geert.Uytterhoeven@xxxxxxxxxxx are

sparsemem-sparse_add_one_section-may-fail-to-allocate-memory.patch
git-kbuild.patch
time-fold-__get_realtime_clock_ts-into-getnstimeofday.patch
ps3-checkpatch-drivers-ps3-ps3-sys-managerc.patch
ps3-checkpatch-drivers-ps3-ps3-vuartc.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux