mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
lib/btree: fix possible NULL pointer dereference
mempool_alloc() can return null in atomic case. Signed-off-by: Denis Kirjanov <[email protected]> Cc: Joern Engel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
bdef2fe88b
commit
43aa7ac736
1 file changed
+2
-1
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user