]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
lightnvm: Avoid validation of default op value
authorHeiner Litz <hlitz@ucsc.edu>
Thu, 29 Mar 2018 22:05:08 +0000 (00:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Mar 2018 23:29:09 +0000 (17:29 -0600)
Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl")
Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/core.c

index 5b197d6bb6d95743282b144668c243dce99b13b8..c4f12b1ae8b8e0141cd0e8acbb167bc57eeccd65 100644 (file)
@@ -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;
        }