From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] habanalabs: fix type of variable
Date: Sun, 11 Jul 2021 15:54:16 +0300 [thread overview]
Message-ID: <20210711125418.17533-5-ogabbay@kernel.org> (raw)
In-Reply-To: <20210711125418.17533-1-ogabbay@kernel.org>
Recently, the size parameter in userptr structure was change to u64.
As a result, we need to change the type of the local range_size
in device_va_to_pa() to u64 to avoid overflow.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
drivers/misc/habanalabs/common/debugfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/misc/habanalabs/common/debugfs.c b/drivers/misc/habanalabs/common/debugfs.c
index 51744e42b808..2c587af28f9b 100644
--- a/drivers/misc/habanalabs/common/debugfs.c
+++ b/drivers/misc/habanalabs/common/debugfs.c
@@ -491,11 +491,10 @@ static int device_va_to_pa(struct hl_device *hdev, u64 virt_addr, u32 size,
struct hl_vm_phys_pg_pack *phys_pg_pack;
struct hl_ctx *ctx = hdev->compute_ctx;
struct hl_vm_hash_node *hnode;
+ u64 end_address, range_size;
struct hl_userptr *userptr;
enum vm_type *vm_type;
bool valid = false;
- u64 end_address;
- u32 range_size;
int i, rc = 0;
if (!ctx) {
--
2.25.1
next prev parent reply other threads:[~2021-07-11 12:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-11 12:54 [PATCH 1/7] habanalabs: missing mutex_unlock in process kill procedure Oded Gabbay
2021-07-11 12:54 ` [PATCH 2/7] habanalabs: rename cb_mmap to mmap Oded Gabbay
2021-07-11 12:54 ` [PATCH 3/7] habanalabs: fix nullifying of destroyed mmu pgt pool Oded Gabbay
2021-07-11 12:54 ` [PATCH 4/7] habanalabs: mark linux image as not loaded after hw_fini Oded Gabbay
2021-07-11 12:54 ` Oded Gabbay [this message]
2021-07-11 12:54 ` [PATCH 6/7] habanalabs: add asic property of host dma offset Oded Gabbay
2021-07-11 12:54 ` [PATCH 7/7] habanalabs: set dma max segment size 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=20210711125418.17533-5-ogabbay@kernel.org \
--to=ogabbay@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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.