[Bugfix] Reject negative --device-ids indices instead of selecting the wrong device (#49053)

Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Vineeth Sai Varikuntla
2026-10-08 13:01:25 +00:00
committed by GitHub
co-authored by Harry Mellor
parent 458ba2edf8
commit 194da61de1
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -2113,7 +2113,7 @@ class EngineArgs:
for x in cvd.split(",")
]
for i in int_ids:
if i >= len(cvd_ids):
if not 0 <= i < len(cvd_ids):
raise ValueError(
f"--device-ids index {i} is out of range for "
f"{current_platform.device_control_env_var}"