Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: fix not close socket with ethtool
Browse files Browse the repository at this point in the history
close socket after use ethtool.NewEthtool()

Fixes: #919

Signed-off-by: Ace-Tang <[email protected]>
  • Loading branch information
Ace-Tang committed Nov 19, 2018
1 parent c0551de commit 4b9a471
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virtcontainers/physical_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func isPhysicalIface(ifaceName string) (bool, error) {
if err != nil {
return false, err
}
defer ethHandle.Close()

bus, err := ethHandle.BusInfo(ifaceName)
if err != nil {
Expand All @@ -142,6 +143,7 @@ func createPhysicalEndpoint(netInfo NetworkInfo) (*PhysicalEndpoint, error) {
if err != nil {
return nil, err
}
defer ethHandle.Close()

// Get BDF
bdf, err := ethHandle.BusInfo(netInfo.Iface.Name)
Expand Down

0 comments on commit 4b9a471

Please sign in to comment.