[Mesa-dev] [PATCH] anv: don't leak DRM devices

Grazvydas Ignotas notasas at gmail.com
Tue May 2 17:17:02 UTC 2017


After successful drmGetDevices2() call, drmFreeDevices() needs to be
called.

Fixes: b1fb6e8d "anv: do not open random render node(s)"
Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
---
 src/intel/vulkan/anv_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 78f133e..98352c9 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -508,10 +508,11 @@ anv_enumerate_devices(struct anv_instance *instance)
                         devices[i]->nodes[DRM_NODE_RENDER]);
          if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
             break;
       }
    }
+   drmFreeDevices(devices, max_devices);
 
    if (result == VK_SUCCESS)
       instance->physicalDeviceCount = 1;
 
    return result;
-- 
2.7.4



More information about the mesa-dev mailing list