Browse Source

jail: remove unreachable code

Replace unreachable error handling code in function setns_open with
a more appropriate assertion.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 3 years ago
parent
commit
111416d10b
1 changed files with 1 additions and 2 deletions
  1. 1 2
      jail/jail.c

+ 1 - 2
jail/jail.c

@@ -1008,8 +1008,7 @@ static int setns_open(unsigned long nstype)
 {
 	int *fd = get_namespace_fd(nstype);
 
-	if (!*fd)
-		return EFAULT;
+	assert(fd != NULL);
 
 	if (*fd == -1)
 		return 0;