stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -fixes 1/2] drm/vmwgfx: Return 0 when gmrid::get_node runs out of ID's
@ 2019-03-20  6:59 Thomas Hellstrom
  2019-03-20  6:59 ` [PATCH -fixes 2/2] drm/vmwgfx: Don't double-free the mode stored in par->set_mode Thomas Hellstrom
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Hellstrom @ 2019-03-20  6:59 UTC (permalink / raw)
  To: dri-devel; +Cc: Deepak Rawat, stable, Thomas Hellstrom

From: Deepak Rawat <drawat@vmware.com>

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>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 
-- 
2.19.0.rc1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-20  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-20  6:59 [PATCH -fixes 1/2] drm/vmwgfx: Return 0 when gmrid::get_node runs out of ID's Thomas Hellstrom
2019-03-20  6:59 ` [PATCH -fixes 2/2] drm/vmwgfx: Don't double-free the mode stored in par->set_mode Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).