diff mbox series

[PATH,i-g-t,10/13] media-bench: Protect against incorrect -b syntax

Message ID 20180905134939.2942-11-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Tracing & workload simulation misc patches | expand

Commit Message

Tvrtko Ursulin Sept. 5, 2018, 1:49 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

-b is to pass the command argument directly to gem_wsim so must include
another -b.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 scripts/media-bench.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl
index a3619ceb34cc..5070cae088f3 100755
--- a/scripts/media-bench.pl
+++ b/scripts/media-bench.pl
@@ -341,7 +341,10 @@  ENDHELP
 $verbose = 1 if defined $opts{'v'};
 $gt2 = 1 if defined $opts{'2'};
 $show_cmds = 1 if defined $opts{'x'};
-$balancer = $opts{'b'} if defined $opts{'b'};
+if (defined $opts{'b'}) {
+	die unless substr($opts{'b'}, 0, 2) eq '-b';
+	$balancer = $opts{'b'};
+}
 if (defined $opts{'B'}) {
 	@balancers = split /,/, $opts{'B'};
 } else {