Commit 9d7aa4a4 authored by Heiner Litz's avatar Heiner Litz Committed by Jens Axboe

lightnvm: Avoid validation of default op value

Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl")
Signed-off-by: default avatarHeiner Litz <hlitz@ucsc.edu>
Reviewed-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 40f962d7
......@@ -304,11 +304,9 @@ static int __nvm_config_extended(struct nvm_dev *dev,
}
/* op not set falls into target's default */
if (e->op == 0xFFFF)
if (e->op == 0xFFFF) {
e->op = NVM_TARGET_DEFAULT_OP;
if (e->op < NVM_TARGET_MIN_OP ||
e->op > NVM_TARGET_MAX_OP) {
} else if (e->op < NVM_TARGET_MIN_OP || e->op > NVM_TARGET_MAX_OP) {
pr_err("nvm: invalid over provisioning value\n");
return -EINVAL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment