]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kho: kho_preserve_vmalloc(): don't return 0 when ENOMEM
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 20:36:17 +0000 (12:36 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 27 Jan 2026 03:03:48 +0000 (19:03 -0800)
kho_preserve_vmalloc() should return -ENOMEM when new_vmalloc_chunk()
fails.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202601211636.IRaejjdw-lkp@intel.com/
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/liveupdate/kexec_handover.c

index 96767b106cac787c630d1bff473e7c21f75c815b..90d411a59f76d9a70879853cbb8e979fc36a2a5b 100644 (file)
@@ -1014,8 +1014,10 @@ int kho_preserve_vmalloc(void *ptr, struct kho_vmalloc *preservation)
                chunk->phys[idx++] = phys;
                if (idx == ARRAY_SIZE(chunk->phys)) {
                        chunk = new_vmalloc_chunk(chunk);
-                       if (!chunk)
+                       if (!chunk) {
+                               err = -ENOMEM;
                                goto err_free;
+                       }
                        idx = 0;
                }
        }