jail: remove unreachable code
authorDaniel Golle <daniel@makrotopia.org>
Wed, 9 Dec 2020 11:10:32 +0000 (11:10 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 9 Dec 2020 11:10:32 +0000 (11:10 +0000)
Replace unreachable error handling code in function setns_open with
a more appropriate assertion.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c

index 385dbe7b0336346360ee93e408c6795874e0a14d..a143b53c0a584c8320cb909c0808604f30269067 100644 (file)
@@ -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;