All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Yuri Nudelman <ynudelman@habana.ai>
Subject: [PATCH 5/7] habanalabs: wrong handle removal in memory manager
Date: Fri,  1 Apr 2022 15:20:15 +0300	[thread overview]
Message-ID: <20220401122017.116205-5-ogabbay@kernel.org> (raw)
In-Reply-To: <20220401122017.116205-1-ogabbay@kernel.org>

From: Yuri Nudelman <ynudelman@habana.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@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.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


  parent reply	other threads:[~2022-04-01 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 12:20 [PATCH 1/7] habanalabs: add callback and field to be used for debugfs refactor Oded Gabbay
2022-04-01 12:20 ` [PATCH 2/7] habanalabs: unify code for memory access from debugfs Oded Gabbay
2022-04-01 12:20 ` [PATCH 3/7] habanalabs: enforce alignment upon registers access through debugfs Oded Gabbay
2022-04-01 12:20 ` [PATCH 4/7] habanalabs: remove debugfs read/write callbacks Oded Gabbay
2022-04-01 12:20 ` Oded Gabbay [this message]
2022-04-01 12:20 ` [PATCH 6/7] habanalabs: remove redundant info print Oded Gabbay
2022-04-01 12:20 ` [PATCH 7/7] habanalabs: change a reset print to debug level Oded Gabbay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220401122017.116205-5-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ynudelman@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.