diff --git a/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc b/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc index 0277a7d3b75..52256a75a3c 100644 --- a/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc +++ b/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc @@ -925,8 +925,10 @@ static int TryToReadNumaNode(const string &pci_bus_id, int device_ordinal) { LOG(INFO) << "successful NUMA node read from SysFS had negative value (" << value << "), but there must be at least one NUMA node" ", so returning NUMA node zero"; + fclose(file); return 0; } + fclose(file); return value; } @@ -934,6 +936,7 @@ static int TryToReadNumaNode(const string &pci_bus_id, int device_ordinal) { << "could not convert SysFS file contents to integral NUMA node value: " << content; + fclose(file); return kUnknownNumaNode; #endif }