soc/tegra: fuse: Don't return -ENOMEM when allocate lookups failed
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 12 Apr 2021 14:05:27 +0000 (22:05 +0800)
committerThierry Reding <treding@nvidia.com>
Wed, 2 Jun 2021 08:58:55 +0000 (10:58 +0200)
fuse->base can not be unmapped if allocate lookups failed in
tegra_init_fuse(), because it is an early_initcall, the driver
will be loaded anyway and fuse->base will be accessed by other
functions later, so remove the return -ENOMEM after allocating
lookups failed to make less confusing.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
[treding@nvidia.com: drop error message, out-of-memory is noisy anyway]
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/fuse/fuse-tegra.c

index 94b60a6..3d9da3d 100644 (file)
@@ -489,10 +489,8 @@ static int __init tegra_init_fuse(void)
                size_t size = sizeof(*fuse->lookups) * fuse->soc->num_lookups;
 
                fuse->lookups = kmemdup(fuse->soc->lookups, size, GFP_KERNEL);
-               if (!fuse->lookups)
-                       return -ENOMEM;
-
-               nvmem_add_cell_lookups(fuse->lookups, fuse->soc->num_lookups);
+               if (fuse->lookups)
+                       nvmem_add_cell_lookups(fuse->lookups, fuse->soc->num_lookups);
        }
 
        return 0;