mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-16 14:28:35 +00:00
Merge pull request #918 from Ace-Tang/master
virtcontainers: fix not close socket with ethtool
This commit is contained in:
@@ -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 {
|
||||
@@ -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)
|
||||
|
Reference in New Issue
Block a user