Merge tag 'drm-msm-next-2018-01-10' of git://people.freedesktop.org/~robclark/linux...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / amd / amdkfd / kfd_flat_memory.c
index c59384bbbc5fc6befa302f99d10b6fdc0b30af94..7377513050e663901071486492ce9a1881a65353 100644 (file)
@@ -300,9 +300,14 @@ int kfd_init_apertures(struct kfd_process *process)
        struct kfd_process_device *pdd;
 
        /*Iterating over all devices*/
-       while ((dev = kfd_topology_enum_kfd_devices(id)) != NULL &&
+       while (kfd_topology_enum_kfd_devices(id, &dev) == 0 &&
                id < NUM_OF_SUPPORTED_GPUS) {
 
+               if (!dev) {
+                       id++; /* Skip non GPU devices */
+                       continue;
+               }
+
                pdd = kfd_create_process_device_data(dev, process);
                if (!pdd) {
                        pr_err("Failed to create process device data\n");