]> git.baikalelectronics.ru Git - kernel.git/commitdiff
habanalabs: initialize variable explicitly
authorOded Gabbay <ogabbay@kernel.org>
Tue, 5 Jul 2022 08:04:56 +0000 (11:04 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 12 Jul 2022 06:09:30 +0000 (09:09 +0300)
Fix warning of
"warning: ‘old_base’ may be used uninitialized in this function"

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c

index 99d84b46aeb6aa3e3ecc4adcd9e9bb21f24ae796..5a76d7689abe8b3818fd028065b53b3efcc8dbc2 100644 (file)
@@ -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);