diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2013-01-17 18:13:46 +0100 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2013-07-07 18:19:23 +0200 |
commit | c1e854e924f354657ea2ad08fd7b38aac81c59b1 (patch) | |
tree | e8058670390c934dbb835bf5be9b18edab829823 /mm/mremap.c | |
parent | slub: Make cpu partial slab support configurable (diff) | |
download | linux-c1e854e924f354657ea2ad08fd7b38aac81c59b1.tar.xz linux-c1e854e924f354657ea2ad08fd7b38aac81c59b1.zip |
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>
Diffstat (limited to 'mm/mremap.c')
0 files changed, 0 insertions, 0 deletions