mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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: e80d1c805a ("dm: do not override error code returned from dm_get_device()")
Cc: [email protected] # 4.3+
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
This commit is contained in:
parent
1b1b58f54f
commit
bff7e067ee
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue