summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-08-08 14:09:27 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-06 10:40:15 +0100
commit3fae2a9e994b41603dbe1a5f32503cf558cf77f7 (patch)
tree31885b7b7b2a72088b6fcabb1d09cfeb34dcee4e /drivers/md
parente74fb822281ecd034a381b0c3dd1b9d63caf1f25 (diff)
dm flakey: return -EINVAL on interval bounds error in flakey_ctr()
commit bff7e067ee518f9ed7e1cbc63e4c9e01670d0b71 upstream. 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()") Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 6a2e8dd44a1b..3643cba71351 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;
}