[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220705082351.2713945-1-ogabbay@kernel.org>
Date: Tue, 5 Jul 2022 11:23:51 +0300
From: Oded Gabbay <ogabbay@...nel.org>
To: linux-kernel@...r.kernel.org
Subject: [PATCH] habanalabs: initialize variable explicitly
Fix warning of
"warning: ‘old_base’ may be used uninitialized in this function"
Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
---
drivers/misc/habanalabs/common/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 99d84b46aeb6..5a76d7689abe 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -52,7 +52,7 @@ static int hl_access_sram_dram_region(struct hl_device *hdev, u64 addr, u64 *val
enum debugfs_access_type acc_type, enum pci_region region_type)
{
struct pci_mem_region *region = &hdev->pci_mem_region[region_type];
- u64 old_base, rc;
+ u64 old_base = 0, rc;
if (region_type == PCI_REGION_DRAM) {
old_base = hl_set_dram_bar(hdev, addr);
--
2.25.1
Powered by blists - more mailing lists