* [PATCH] habanalabs: Fix static analysis error
@ 2020-05-27 8:00 Tomer Tayar
2020-05-27 10:51 ` Oded Gabbay
0 siblings, 1 reply; 2+ messages in thread
From: Tomer Tayar @ 2020-05-27 8:00 UTC (permalink / raw)
To: oded.gabbay, SW_Drivers; +Cc: linux-kernel
Fix the following smatch error in unmap_device_va():
error: uninitialized symbol 'rc'.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
---
drivers/misc/habanalabs/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/memory.c b/drivers/misc/habanalabs/memory.c
index 4b8eed1ca513..47da84a17719 100644
--- a/drivers/misc/habanalabs/memory.c
+++ b/drivers/misc/habanalabs/memory.c
@@ -1023,7 +1023,7 @@ static int unmap_device_va(struct hl_ctx *ctx, u64 vaddr, bool ctx_free)
struct hl_va_range *va_range;
enum vm_type_t *vm_type;
bool is_userptr;
- int rc;
+ int rc = 0;
/* protect from double entrance */
mutex_lock(&ctx->mem_hash_lock);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] habanalabs: Fix static analysis error
2020-05-27 8:00 [PATCH] habanalabs: Fix static analysis error Tomer Tayar
@ 2020-05-27 10:51 ` Oded Gabbay
0 siblings, 0 replies; 2+ messages in thread
From: Oded Gabbay @ 2020-05-27 10:51 UTC (permalink / raw)
To: Tomer Tayar; +Cc: SW_Drivers, Linux-Kernel@Vger. Kernel. Org
On Wed, May 27, 2020 at 11:00 AM Tomer Tayar <ttayar@habana.ai> wrote:
>
> Fix the following smatch error in unmap_device_va():
> error: uninitialized symbol 'rc'.
>
> Signed-off-by: Tomer Tayar <ttayar@habana.ai>
> ---
> drivers/misc/habanalabs/memory.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/habanalabs/memory.c b/drivers/misc/habanalabs/memory.c
> index 4b8eed1ca513..47da84a17719 100644
> --- a/drivers/misc/habanalabs/memory.c
> +++ b/drivers/misc/habanalabs/memory.c
> @@ -1023,7 +1023,7 @@ static int unmap_device_va(struct hl_ctx *ctx, u64 vaddr, bool ctx_free)
> struct hl_va_range *va_range;
> enum vm_type_t *vm_type;
> bool is_userptr;
> - int rc;
> + int rc = 0;
>
> /* protect from double entrance */
> mutex_lock(&ctx->mem_hash_lock);
> --
> 2.17.1
>
This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Applied to -fixes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-27 10:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 8:00 [PATCH] habanalabs: Fix static analysis error Tomer Tayar
2020-05-27 10:51 ` Oded Gabbay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).