plugins/amdgpu: Fix strtoul error handling

Copilot reports a possible false positive error on strtoul conversion due
errno not being reset on success. Fix it by clearing errnor prior to the
call.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
This commit is contained in:
Tvrtko Ursulin 2026-05-20 09:09:10 +01:00 committed by Andrei Vagin
parent eca9732519
commit 71be2f42ea

View file

@ -334,6 +334,7 @@ static size_t getenv_size_t(const char *var, size_t defvalue)
int sh = 0;
if (value_str) {
errno = 0;
val = (size_t)strtoul(value_str, &endp, 0);
if (errno || value_str == endp) {
pr_err("Ignoring invalid value for %s=%s, expecting a positive integer\n", var, value_str);