Some coverity cleanups (#41596)

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-04-12 14:00:49 +02:00
committed by GitHub
5 changed files with 34 additions and 17 deletions
+7 -5
View File
@@ -2048,11 +2048,13 @@ static int event_add_pressure(
if (errno != ENOENT)
return -errno;
/* We got ENOENT. Three options now: try the fallback if we have one, or return the error as
* is (if based on user/env config), or return -EOPNOTSUPP (because we picked the path, and
* the PSI service apparently is not supported) */
if (!watch_fallback)
return locked ? -ENOENT : -EOPNOTSUPP;
/* We got ENOENT. Two options now: try the fallback if we have one, or return the error as is
* (when based on user/env config). */
if (!watch_fallback) {
assert(locked);
return -ENOENT;
}
path_fd = open(watch_fallback, O_PATH|O_CLOEXEC);
if (path_fd < 0) {