summaryrefslogtreecommitdiff
path: root/mm/kmemcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/kmemcheck.c')
-rw-r--r--mm/kmemcheck.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/kmemcheck.c b/mm/kmemcheck.c
index cab58bb59..5bf191756 100644
--- a/mm/kmemcheck.c
+++ b/mm/kmemcheck.c
@@ -20,8 +20,7 @@ void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node)
shadow = alloc_pages_node(node, flags | __GFP_NOTRACK, order);
if (!shadow) {
if (printk_ratelimit())
- printk(KERN_ERR "kmemcheck: failed to allocate "
- "shadow bitmap\n");
+ pr_err("kmemcheck: failed to allocate shadow bitmap\n");
return;
}
@@ -60,6 +59,9 @@ void kmemcheck_free_shadow(struct page *page, int order)
void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object,
size_t size)
{
+ if (unlikely(!object)) /* Skip object if allocation failed */
+ return;
+
/*
* Has already been memset(), which initializes the shadow for us
* as well.