Commit 43aa7ac7 authored by kirjanov@gmail.com's avatar kirjanov@gmail.com Committed by Linus Torvalds

lib/btree: fix possible NULL pointer dereference

mempool_alloc() can return null in atomic case.
Signed-off-by: default avatarDenis Kirjanov <kirjanov@gmail.com>
Cc: Joern Engel <joern@logfs.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bdef2fe8
......@@ -95,7 +95,8 @@ static unsigned long *btree_node_alloc(struct btree_head *head, gfp_t gfp)
unsigned long *node;
node = mempool_alloc(head->mempool, gfp);
memset(node, 0, NODESIZE);
if (likely(node))
memset(node, 0, NODESIZE);
return node;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment