summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepak Rawat <drawat@vmware.com>2019-02-28 10:29:54 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-27 14:14:38 +0900
commit69e26237ed1ec43f574b603413dd713efc2a6c95 (patch)
tree2aad74611e0612efb5a1f11f261ef9591ddf4741
parentab483d1ca7ae19e3057f2500f5b8dd65f5319319 (diff)
downloadlinux-rt-69e26237ed1ec43f574b603413dd713efc2a6c95.tar.gz
drm/vmwgfx: Return 0 when gmrid::get_node runs out of ID's
commit 4b9ce3a651a37c60527101db4451a315a8b9588f upstream. If it's not a system error and get_node implementation accommodate the buffer object then it should return 0 with memm::mm_node set to NULL. v2: Test for id != -ENOMEM instead of id == -ENOSPC. Cc: <stable@vger.kernel.org> Fixes: 4eb085e42fde ("drm/vmwgfx: Convert to new IDA API") Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index b93c558dd86e..7da752ca1c34 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -57,7 +57,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;
+ return (id != -ENOMEM ? 0 : id);
spin_lock(&gman->lock);