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

David Zhang dingchen.zhang at amd.com
Wed Apr 13 20:03:58 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 3dc39de3..f40bf183 100644
--- a/tests/amdgpu/amd_psr.c
+++ b/tests/amdgpu/amd_psr.c
@@ -474,7 +474,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