[igt-dev] [PATCH v2 2/4] tests/amdgpu/amd_psr: set visual-confirm option required argument

David Zhang dingchen.zhang at amd.com
Mon Apr 18 22:18:18 UTC 2022


[why & how]
previously set to optional argument, and the command line argument
set for visual confirm debug option would cause NULL optarg string
and thus hit system segmentation fault.

set the "visual-confirm" from optional to required argument.

Cc: Rodrigo Siqueira <rodrigo.siqueira at amd.com>
Cc: Harry Wentland <harry.wentland at amd.com>
Cc: Leo Li <sunpeng.li at amd.com>
Cc: Jay Pillai <aurabindo.pillai at amd.com>
Cc: Wayne Lin <wayne.lin at amd.com>

Signed-off-by: David Zhang <dingchen.zhang at amd.com>
---
 tests/amdgpu/amd_psr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/amdgpu/amd_psr.c b/tests/amdgpu/amd_psr.c
index e3a2cb4a..834fefcc 100644
--- a/tests/amdgpu/amd_psr.c
+++ b/tests/amdgpu/amd_psr.c
@@ -491,7 +491,7 @@ const char *help_str =
 "  --visual-confirm           PSR visual confirm debug option enable\n";
 
 struct option long_options[] = {
-	{"visual-confirm",	optional_argument, NULL, 'v'},
+	{"visual-confirm",	required_argument, NULL, 'v'},
 	{ 0, 0, 0, 0 }
 };
 
-- 
2.25.1



More information about the igt-dev mailing list