From: Zhou Yuhang <[email protected]>

Add the missing close() in the pid_max_cb() function.

Signed-off-by: Zhou Yuhang <[email protected]>
---
 tools/testing/selftests/pid_namespace/pid_max.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/pid_namespace/pid_max.c 
b/tools/testing/selftests/pid_namespace/pid_max.c
index 96f274f0582b..41f8b943bc96 100644
--- a/tools/testing/selftests/pid_namespace/pid_max.c
+++ b/tools/testing/selftests/pid_namespace/pid_max.c
@@ -61,6 +61,7 @@ static int pid_max_cb(void *data)
        }
 
        ret = write(fd, "500", sizeof("500") - 1);
+       close(fd);
        if (ret < 0) {
                fprintf(stderr, "%m - Failed to write pid_max\n");
                return -1;
-- 
2.33.0


Reply via email to