habanalabs: initialize variable to default value
authorTomer Tayar <ttayar@habana.ai>
Mon, 1 Jun 2020 06:56:47 +0000 (09:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jun 2020 07:08:10 +0000 (09:08 +0200)
Fix the following smatch error in unmap_device_va():
error: uninitialized symbol 'rc'.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Link: https://lore.kernel.org/r/20200601065648.8775-1-oded.gabbay@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/memory.c

index 4b8eed1..47da84a 100644 (file)
@@ -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);