[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] [PATCH] dm-thinp: check allocation failure
- From: Mikulas Patocka <mpatocka redhat com>
- To: Edward Thornber <thornber redhat com>
- Cc: dm-devel redhat com
- Subject: [dm-devel] [PATCH] dm-thinp: check allocation failure
- Date: Thu, 4 Aug 2011 12:09:01 -0400 (EDT)
dm-thinp: check allocation failure
Signed-off-by: Mikulas Patocka <mpatocka redhat com>
---
drivers/md/dm-thin.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-3.0-fast/drivers/md/dm-thin.c
===================================================================
--- linux-3.0-fast.orig/drivers/md/dm-thin.c 2011-08-04 18:07:18.000000000 +0200
+++ linux-3.0-fast/drivers/md/dm-thin.c 2011-08-04 18:07:37.000000000 +0200
@@ -160,6 +160,10 @@ static struct bio_prison *prison_create(
spin_lock_init(&prison->lock);
prison->cell_pool = mempool_create_kmalloc_pool(nr_cells,
sizeof(struct cell));
+ if (!prison->cell_pool) {
+ kfree(prison);
+ return NULL;
+ }
prison->nr_buckets = nr_buckets;
prison->hash_mask = nr_buckets - 1;
prison->cells = (struct hlist_head *) (prison + 1);
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]