summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-galois.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/ec/src/ec-galois.c')
-rw-r--r--xlators/cluster/ec/src/ec-galois.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/cluster/ec/src/ec-galois.c b/xlators/cluster/ec/src/ec-galois.c
index 7dbbac09713..8cb4dc2e4e3 100644
--- a/xlators/cluster/ec/src/ec-galois.c
+++ b/xlators/cluster/ec/src/ec-galois.c
@@ -15,6 +15,7 @@
#include "ec-mem-types.h"
#include "ec-gf8.h"
+#include "ec-helpers.h"
static ec_gf_t *
ec_gf_alloc(uint32_t bits, uint32_t mod)
@@ -48,7 +49,7 @@ failed_log:
failed_gf:
GF_FREE(gf);
failed:
- return NULL;
+ return EC_ERR(ENOMEM);
}
static void
@@ -79,7 +80,7 @@ ec_gf_prepare(uint32_t bits, uint32_t mod)
uint32_t i, j;
if (bits != 8) {
- return NULL;
+ return EC_ERR(EINVAL);
}
tbl = ec_gf8_mul;
@@ -88,8 +89,8 @@ ec_gf_prepare(uint32_t bits, uint32_t mod)
}
gf = ec_gf_alloc(bits, mod);
- if (gf == NULL) {
- return NULL;
+ if (EC_IS_ERR(gf)) {
+ return gf;
}
ec_gf_init_tables(gf);