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

Tvrtko Ursulin
2018-09-05T13:49:55Z

-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 --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 {