From: Yuri Nudelman Date: Sun, 27 Mar 2022 08:41:51 +0000 (+0300) Subject: habanalabs: wrong handle removal in memory manager X-Git-Tag: v6.1-rc5~1160^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd92c3678ab3158f11319ea08b81ac58beb519c7;p=platform%2Fkernel%2Flinux-starfive.git habanalabs: wrong handle removal in memory manager During the unified memory manager release, a wrong id was used to remove an entry from the idr. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/habanalabs/common/memory_mgr.c b/drivers/misc/habanalabs/common/memory_mgr.c index 3828ba4..a1f499a 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)