]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/vmwgfx: Fix error handling in get_node
authorZack Rusin <zackr@vmware.com>
Fri, 25 Sep 2020 15:54:10 +0000 (11:54 -0400)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 30 Sep 2020 03:44:28 +0000 (05:44 +0200)
ttm_mem_type_manager_func.get_node was changed to return -ENOSPC
instead of setting the node pointer to NULL. Unfortunately
vmwgfx still had two places where it was explicitly converting
-ENOSPC to 0 causing regressions. This fixes those spots by
allowing -ENOSPC to be returned. That seems to fix recent
regressions with vmwgfx.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Sigend-off-by: Roland Scheidegger <sroland@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
drivers/gpu/drm/vmwgfx/vmwgfx_thp.c

index 4a76fc7114adcfb528ad06a9ad5840e8a60f5a38..f8bdd4ea294a6695ac074564b58eb9456af94bf4 100644 (file)
@@ -55,7 +55,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man,
 
        id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL);
        if (id < 0)
-               return (id != -ENOMEM ? 0 : id);
+               return id;
 
        spin_lock(&gman->lock);
 
index b7c816ba71663b61de1e25dfed8033b6fcedd1fd..c8b9335bccd8d8fccfbdf40cdff7096ce6448bb5 100644 (file)
@@ -95,7 +95,7 @@ found_unlock:
                mem->start = node->start;
        }
 
-       return 0;
+       return ret;
 }