Merge tag 'drm-next-2019-07-19' of git://anongit.freedesktop.org/drm/drm
[sfrench/cifs-2.6.git] / drivers / gpu / drm / nouveau / nouveau_dmem.c
index 42c026010938db26adc14e6bb6f6ca629f131c20..1333220787a1ba7e9619135b52ce426b5fe109a3 100644 (file)
@@ -379,9 +379,10 @@ nouveau_dmem_pages_alloc(struct nouveau_drm *drm,
                        ret = nouveau_dmem_chunk_alloc(drm);
                        if (ret) {
                                if (c)
-                                       break;
+                                       return 0;
                                return ret;
                        }
+                       mutex_lock(&drm->dmem->mutex);
                        continue;
                }