Prev: [PATCH 1/2] lib/btree: Kill unused MAX macro
Next: [PATCH] i2c-i801: fix all coding style issues found by checkpatch.pl
From: Denis Kirjanov kirjanov on 12 May 2010 17:20 mempool_alloc can return null in atomic case. Signed-off-by: Denis Kirjanov <kirjanov(a)gmail.com> --- diff --git a/lib/btree.c b/lib/btree.c index 41859a8..542c904 100644 --- a/lib/btree.c +++ b/lib/btree.c @@ -95,7 +94,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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |