Thread (3 messages) 3 messages, 3 authors, 2018-02-27

Re: [PATCH][RESEND] lightnvm: Avoid validation of default op value

From: Matias Bjørling <hidden>
Date: 2018-02-27 07:44:11

On 02/26/2018 09:22 PM, Heiner Litz wrote:
quoted hunk ↗ jump to hunk
Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl")

Signed-off-by: Heiner Litz <redacted>
---
  drivers/lightnvm/core.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index dcc9e621e651..74b53fc1b813 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -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;
  	}
Thanks Heiner. Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help