aboutsummaryrefslogtreecommitdiff
path: root/pkg/netns/netns_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/netns/netns_linux.go')
-rw-r--r--pkg/netns/netns_linux.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/netns/netns_linux.go b/pkg/netns/netns_linux.go
index a72a2d098..4a515c72a 100644
--- a/pkg/netns/netns_linux.go
+++ b/pkg/netns/netns_linux.go
@@ -83,7 +83,9 @@ func NewNS() (ns.NetNS, error) {
if err != nil {
return nil, err
}
- mountPointFd.Close()
+ if err := mountPointFd.Close(); err != nil {
+ return nil, err
+ }
// Ensure the mount point is cleaned up on errors; if the namespace
// was successfully mounted this will have no effect because the file