[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220401122017.116205-5-ogabbay@kernel.org>
Date: Fri, 1 Apr 2022 15:20:15 +0300
From: Oded Gabbay <ogabbay@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Yuri Nudelman <ynudelman@...ana.ai>
Subject: [PATCH 5/7] habanalabs: wrong handle removal in memory manager
From: Yuri Nudelman <ynudelman@...ana.ai>
During the unified memory manager release, a wrong id was used to remove
an entry from the idr.
Signed-off-by: Yuri Nudelman <ynudelman@...ana.ai>
Reviewed-by: Oded Gabbay <ogabbay@...nel.org>
Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
---
drivers/misc/habanalabs/common/memory_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/common/memory_mgr.c b/drivers/misc/habanalabs/common/memory_mgr.c
index 3828ba44c660..a1f499a1519c 100644
--- a/drivers/misc/habanalabs/common/memory_mgr.c
+++ b/drivers/misc/habanalabs/common/memory_mgr.c
@@ -48,7 +48,7 @@ static void hl_mmap_mem_buf_release(struct kref *kref)
container_of(kref, struct hl_mmap_mem_buf, refcount);
spin_lock(&buf->mmg->lock);
- idr_remove(&buf->mmg->handles, buf->handle);
+ idr_remove(&buf->mmg->handles, lower_32_bits(buf->handle >> PAGE_SHIFT));
spin_unlock(&buf->mmg->lock);
if (buf->ops->release)
--
2.25.1
Powered by blists - more mailing lists