mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
lib/btree: fix possible NULL pointer dereference
mempool_alloc() can return null in atomic case. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Cc: Joern Engel <joern@logfs.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
bdef2fe88b
commit
43aa7ac736
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user