mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-24 01:24:26 +01:00
virtcontainers: fix not close socket with ethtool
close socket after use ethtool.NewEthtool() Fixes: #919 Signed-off-by: Ace-Tang <aceapril@126.com>
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