[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220316195034.3821108-1-bob.beckett@collabora.com>
Date: Wed, 16 Mar 2022 19:50:34 +0000
From: Robert Beckett <bob.beckett@...labora.com>
To: dri-devel@...ts.freedesktop.org,
Christian Koenig <christian.koenig@....com>,
Huang Rui <ray.huang@....com>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>
Cc: Robert Beckett <bob.beckett@...labora.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/ttm: fix uninit ptr deref in range manager alloc error path
ttm_range_man_alloc would try to ttm_resource_fini the res pointer
before it is allocated.
Fixes: de3688e469b0 (drm/ttm: add ttm_resource_fini v2)
Signed-off-by: Robert Beckett <bob.beckett@...labora.com>
---
drivers/gpu/drm/ttm/ttm_range_manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c
index 5662627bb933..1b4d8ca52f68 100644
--- a/drivers/gpu/drm/ttm/ttm_range_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_range_manager.c
@@ -89,7 +89,7 @@ static int ttm_range_man_alloc(struct ttm_resource_manager *man,
spin_unlock(&rman->lock);
if (unlikely(ret)) {
- ttm_resource_fini(man, *res);
+ ttm_resource_fini(man, &node->base);
kfree(node);
return ret;
}
--
2.25.1
Powered by blists - more mailing lists