diff options
author | Revanth Rajashekar <revanth.rajashekar@intel.com> | 2019-06-27 18:31:09 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-06-29 11:40:31 -0400 |
commit | 15ddffcb341392ba56a28a0ff5d19d8f8cde1b80 (patch) | |
tree | 9db30c853a83c8919c42f717d2e29b9133bb42c2 /block | |
parent | 5e4c7cf60ec3cad59703c203de1dfb31ea608e6e (diff) |
block: sed-opal: "Never True" conditions
'who' an unsigned variable in stucture opal_session_info
can never be lesser than zero. Hence, the condition
"who < OPAL_ADMIN1" can never be true.
Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/sed-opal.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/block/sed-opal.c b/block/sed-opal.c index bb8ef7963d11..c54019c11e91 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c | |||
@@ -2114,8 +2114,7 @@ static int opal_lock_unlock(struct opal_dev *dev, | |||
2114 | { | 2114 | { |
2115 | int ret; | 2115 | int ret; |
2116 | 2116 | ||
2117 | if (lk_unlk->session.who < OPAL_ADMIN1 || | 2117 | if (lk_unlk->session.who > OPAL_USER9) |
2118 | lk_unlk->session.who > OPAL_USER9) | ||
2119 | return -EINVAL; | 2118 | return -EINVAL; |
2120 | 2119 | ||
2121 | mutex_lock(&dev->dev_lock); | 2120 | mutex_lock(&dev->dev_lock); |
@@ -2193,9 +2192,7 @@ static int opal_set_new_pw(struct opal_dev *dev, struct opal_new_pw *opal_pw) | |||
2193 | }; | 2192 | }; |
2194 | int ret; | 2193 | int ret; |
2195 | 2194 | ||
2196 | if (opal_pw->session.who < OPAL_ADMIN1 || | 2195 | if (opal_pw->session.who > OPAL_USER9 || |
2197 | opal_pw->session.who > OPAL_USER9 || | ||
2198 | opal_pw->new_user_pw.who < OPAL_ADMIN1 || | ||
2199 | opal_pw->new_user_pw.who > OPAL_USER9) | 2196 | opal_pw->new_user_pw.who > OPAL_USER9) |
2200 | return -EINVAL; | 2197 | return -EINVAL; |
2201 | 2198 | ||