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

Tvrtko Ursulin tursulin at ursulin.net
Wed Sep 5 13:49:36 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at 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 at 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 {
-- 
2.17.1



More information about the igt-dev mailing list