From 3f4362cedee499beb6a872b3dbb3ac920aa51d21 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 4 Jun 2009 06:13:58 +0000 Subject: read-ahead: unwind with a return value of -1 and error code of ENOMEM on memory allocation for ra_file in open/create Signed-off-by: Anand V. Avati --- xlators/performance/read-ahead/src/read-ahead.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/performance/read-ahead/src/read-ahead.c') diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 912e61dee..24a10eea0 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -57,6 +57,8 @@ ra_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, file = CALLOC (1, sizeof (*file)); if (!file) { + op_ret = -1; + op_errno = ENOMEM; gf_log (this->name, GF_LOG_ERROR, "out of memory"); goto unwind; @@ -124,6 +126,8 @@ ra_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, file = CALLOC (1, sizeof (*file)); if (!file) { + op_ret = -1; + op_errno = ENOMEM; gf_log (this->name, GF_LOG_ERROR, "out of memory"); goto unwind; -- cgit