FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-04-2011, 04:09 PM
Mikulas Patocka
 
Default dm-thinp: check allocation failure

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);

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 01:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org