[CRIU] [PATCH 2/3] vdso: don't call close() for a negative value

Andrey Vagin avagin at openvz.org
Fri Feb 5 11:03:29 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

CID 157801 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
19. negative_returns: fd is passed to a parameter that cannot be negative.

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 vdso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vdso.c b/vdso.c
index c547cf5..bccf11c 100644
--- a/vdso.c
+++ b/vdso.c
@@ -212,7 +212,7 @@ int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,
 	}
 	exit_code = 0;
 err:
-	close(fd);
+	close_safe(&fd);
 	return exit_code;
 }
 
-- 
2.4.3



More information about the CRIU mailing list