linux/mm
Steven Rostedt c1e854e924 slob: Check for NULL pointer before calling ctor()
While doing some code inspection, I noticed that the slob constructor
method can be called with a NULL pointer. If memory is tight and slob
fails to allocate with slob_alloc() or slob_new_pages() it still calls
the ctor() method with a NULL pointer. Looking at the first ctor()
method I found, I noticed that it can not handle a NULL pointer (I'm
sure others probably can't either):

static void sighand_ctor(void *data)
{
        struct sighand_struct *sighand = data;

        spin_lock_init(&sighand->siglock);
        init_waitqueue_head(&sighand->signalfd_wqh);
}

The solution is to only call the ctor() method if allocation succeeded.

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2013-07-07 19:19:23 +03:00
..
backing-dev.c
balloon_compaction.c
bootmem.c
bounce.c
cleancache.c
compaction.c
debug-pagealloc.c
dmapool.c
fadvise.c
failslab.c
filemap.c
filemap_xip.c
fremap.c
frontswap.c
highmem.c
huge_memory.c mm: clean up transparent hugepage sysfs error messages 2012-12-20 17:40:20 -08:00
hugetlb.c
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h
interval_tree.c
Kconfig
Kconfig.debug
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c
maccess.c
madvise.c
Makefile
memblock.c
memcontrol.c memcg: don't register hotcpu notifier from ->css_alloc() 2012-12-20 17:40:20 -08:00
memory-failure.c
memory.c
memory_hotplug.c
mempolicy.c
mempool.c
migrate.c
mincore.c
mlock.c
mm_init.c
mmap.c
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c
msync.c
nobootmem.c
nommu.c
oom_kill.c
page-writeback.c mm: fix calculation of dirtyable memory 2012-12-20 17:40:18 -08:00
page_alloc.c mm: cma: WARN if freed memory is still in use 2012-12-20 17:40:19 -08:00
page_cgroup.c
page_io.c
page_isolation.c
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
process_vm_access.c
quicklist.c
readahead.c
rmap.c
shmem.c
slab.c slab: fix init_lock_keys 2013-07-07 18:58:31 +03:00
slab.h mm/slab: Sharing s_next and s_stop between slab and slub 2013-07-07 18:37:47 +03:00
slab_common.c mm/slab: Fix /proc/slabinfo unwriteable for slab 2013-07-07 18:37:47 +03:00
slob.c slob: Check for NULL pointer before calling ctor() 2013-07-07 19:19:23 +03:00
slub.c slub: Make cpu partial slab support configurable 2013-07-07 19:09:56 +03:00
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c
swapfile.c
truncate.c
util.c
vmalloc.c
vmscan.c
vmstat.c