diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2017-06-05 12:30:24 +0100 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2017-06-08 09:03:06 +0100 |
commit | 424faaa6a9144695da845ae57ce90c1d0abda8db (patch) | |
tree | 3fe6e4ae7cbf3c8ed7eb983cd8c2676fe4f20c07 /benchmarks | |
parent | 7d18a707d1432cc21416aeb5d0acf5da09f9d4cd (diff) |
gem_wsim: Detect invalid duration range
Maximum has to be larger than minimum and all values positive.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/gem_wsim.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index b6e10ae1..df588fe1 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -444,7 +444,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) fstart = NULL; tmpl = strtol(field, &sep, 10); - if (tmpl == 0 || tmpl == LONG_MIN || tmpl == LONG_MAX) { + if (tmpl <= 0 || tmpl == LONG_MIN || tmpl == LONG_MAX) { if (verbose) fprintf(stderr, "Invalid duration at step %u!\n", @@ -455,7 +455,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) if (sep && *sep == '-') { tmpl = strtol(sep + 1, NULL, 10); - if (tmpl == 0 || + if (tmpl <= 0 || tmpl <= step.duration.min || tmpl == LONG_MIN || tmpl == LONG_MAX) { if (verbose) fprintf(stderr, |