From: Yang Yingliang Date: Mon, 12 Apr 2021 14:05:27 +0000 (+0800) Subject: soc/tegra: fuse: Don't return -ENOMEM when allocate lookups failed X-Git-Tag: accepted/tizen/unified/20230118.172025~6846^2~3^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=854d128b8c6c4fa47810ac7cf87c16b8085c3199;p=platform%2Fkernel%2Flinux-rpi.git soc/tegra: fuse: Don't return -ENOMEM when allocate lookups failed 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 [treding@nvidia.com: drop error message, out-of-memory is noisy anyway] Signed-off-by: Thierry Reding --- diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index 94b60a6..3d9da3d 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -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;