summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_device.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-24 11:02:18 -0700
committerJason Ekstrand <[email protected]>2016-05-27 17:18:33 -0700
commite023c104f738d030c21a519e805705961e4ccf46 (patch)
treed773c1ffee4cba36a83d6d156ee590d6702b83f9 /src/intel/vulkan/anv_device.c
parent9048dee32837d281fe7aee5fe34c438fa95ac9d2 (diff)
anv: strdup the device path into the physical device
This way we don't have to assume that the string coming in is a piece of constant data that exists forever.
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r--src/intel/vulkan/anv_device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index eb40e2d9b35..1ab6c745a26 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -67,7 +67,9 @@ anv_physical_device_init(struct anv_physical_device *device,
device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
device->instance = instance;
- device->path = path;
+
+ assert(strlen(path) < ARRAY_SIZE(device->path));
+ strncpy(device->path, path, ARRAY_SIZE(device->path));
device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
if (!device->chipset_id) {