* [PATCH -next] dm flakey: fix error return code in flakey_ctr()
@ 2016-08-08 14:09 Wei Yongjun
0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2016-08-08 14:09 UTC (permalink / raw)
To: Alasdair Kergon, Mike Snitzer, Shaohua Li, Vivek Goyal
Cc: Wei Yongjun, dm-devel, linux-raid
Fix to return error code -EINVAL instead of 0(r is overwrote to
0 by dm_read_arg() call), as 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>
---
drivers/md/dm-flakey.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
index 19db13e..f0cb0fe 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;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-08 14:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08 14:09 [PATCH -next] dm flakey: fix error return code in flakey_ctr() Wei Yongjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).