Message ID | 20220728122101.28744-8-colyli@suse.de (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Jes Sorensen |
Headers | show |
Series | mdadm-CI for-jes/20220728: patches for merge | expand |
diff --git a/mdadm.c b/mdadm.c index d0c5e6de..56722ed9 100644 --- a/mdadm.c +++ b/mdadm.c @@ -1201,8 +1201,9 @@ int main(int argc, char *argv[]) case O(BUILD, WriteBehind): case O(CREATE, WriteBehind): s.write_behind = DEFAULT_MAX_WRITE_BEHIND; - if (parse_num(&s.write_behind, optarg) != 0 || - s.write_behind < 0 || s.write_behind > 16383) { + if (optarg && + (parse_num(&s.write_behind, optarg) != 0 || + s.write_behind < 0 || s.write_behind > 16383)) { pr_err("Invalid value for maximum outstanding write-behind writes: %s.\n\tMust be between 0 and 16383.\n", optarg); exit(2);