summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-cache-policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-cache-policy.c')
-rw-r--r--drivers/md/dm-cache-policy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-policy.c b/drivers/md/dm-cache-policy.c
index 21c03c570c0..d8005796840 100644
--- a/drivers/md/dm-cache-policy.c
+++ b/drivers/md/dm-cache-policy.c
@@ -119,13 +119,13 @@ struct dm_cache_policy *dm_cache_policy_create(const char *name,
type = get_policy(name);
if (!type) {
DMWARN("unknown policy type");
- return NULL;
+ return ERR_PTR(-EINVAL);
}
p = type->create(cache_size, origin_size, cache_block_size);
if (!p) {
put_policy(type);
- return NULL;
+ return ERR_PTR(-ENOMEM);
}
p->private = type;