habanalabs: use dev_dbg() when hl_mmap_mem_buf_get() fails
authorTomer Tayar <ttayar@habana.ai>
Thu, 24 Nov 2022 09:12:38 +0000 (11:12 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Thu, 26 Jan 2023 08:56:20 +0000 (10:56 +0200)
As hl_mmap_mem_buf_get() is called also from IOCTLs which can have a
bad handle from user, modify the print for "no match to handle" to use
dev_dbg().
Calls to this function which are not dependent on user, already have an
error print when the function fails.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/memory_mgr.c

index e652db6..92d20ed 100644 (file)
@@ -25,8 +25,7 @@ struct hl_mmap_mem_buf *hl_mmap_mem_buf_get(struct hl_mem_mgr *mmg, u64 handle)
        buf = idr_find(&mmg->handles, lower_32_bits(handle >> PAGE_SHIFT));
        if (!buf) {
                spin_unlock(&mmg->lock);
-               dev_warn(mmg->dev,
-                        "Buff get failed, no match to handle %#llx\n", handle);
+               dev_dbg(mmg->dev, "Buff get failed, no match to handle %#llx\n", handle);
                return NULL;
        }
        kref_get(&buf->refcount);