mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-22 06:54:27 +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
1 changed files with 2 additions and 1 deletions
|
@ -95,7 +95,8 @@ static unsigned long *btree_node_alloc(struct btree_head *head, gfp_t gfp)
|
||||||
unsigned long *node;
|
unsigned long *node;
|
||||||
|
|
||||||
node = mempool_alloc(head->mempool, gfp);
|
node = mempool_alloc(head->mempool, gfp);
|
||||||
memset(node, 0, NODESIZE);
|
if (likely(node))
|
||||||
|
memset(node, 0, NODESIZE);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue