summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-08-08 14:09:27 +0000
committerMike Snitzer <snitzer@redhat.com>2016-11-21 09:52:07 -0500
commitbff7e067ee518f9ed7e1cbc63e4c9e01670d0b71 (patch)
tree67f1f9b74872bce60a1ce0d36f0c0b592355f97b /drivers/md
parent1b1b58f54fdb1d28a85ab9e1b6d3d6b9b37f4ac7 (diff)
downloadop-kernel-dev-bff7e067ee518f9ed7e1cbc63e4c9e01670d0b71.zip
op-kernel-dev-bff7e067ee518f9ed7e1cbc63e4c9e01670d0b71.tar.gz
dm flakey: return -EINVAL on interval bounds error in flakey_ctr()
Fix to return error code -EINVAL instead of 0, as is done elsewhere in this function. Fixes: e80d1c805a3b ("dm: do not override error code returned from dm_get_device()") Cc: stable@vger.kernel.org # 4.3+ Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-flakey.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
index 6a2e8dd..3643cba 100644
--- a/drivers/md/dm-flakey.c
+++ b/drivers/md/dm-flakey.c
@@ -200,11 +200,13 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
if (!(fc->up_interval + fc->down_interval)) {
ti->error = "Total (up + down) interval is zero";
+ r = -EINVAL;
goto bad;
}
if (fc->up_interval + fc->down_interval < fc->up_interval) {
ti->error = "Interval overflow";
+ r = -EINVAL;
goto bad;
}
OpenPOWER on IntegriCloud