summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/ioc-inode.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-06-11 01:46:04 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-11 08:01:14 -0700
commit1125e8cbc072753fab78ba735bed3f29db61fcc4 (patch)
tree6069a8b2f62540bcb5347737971be0868f3255e2 /xlators/performance/io-cache/src/ioc-inode.c
parent180cfc0c4b6b9a46da35a536a565f010babfa4a7 (diff)
io-cache: handle memory allocation failures
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/performance/io-cache/src/ioc-inode.c')
-rw-r--r--xlators/performance/io-cache/src/ioc-inode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c
index 602077202..c131a48f2 100644
--- a/xlators/performance/io-cache/src/ioc-inode.c
+++ b/xlators/performance/io-cache/src/ioc-inode.c
@@ -150,7 +150,9 @@ ioc_inode_update (ioc_table_t *table, inode_t *inode, uint32_t weight)
ioc_inode_t *ioc_inode = NULL;
ioc_inode = CALLOC (1, sizeof (ioc_inode_t));
- ERR_ABORT (ioc_inode);
+ if (ioc_inode == NULL) {
+ goto out;
+ }
ioc_inode->table = table;
@@ -173,6 +175,7 @@ ioc_inode_update (ioc_table_t *table, inode_t *inode, uint32_t weight)
pthread_mutex_init (&ioc_inode->inode_lock, NULL);
ioc_inode->weight = weight;
+out:
return ioc_inode;
}