Skip to content

Commit 412a32f

Browse files
committed
kho: kho_preserve_vmalloc(): don't return 0 when ENOMEM
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>
1 parent e86436a commit 412a32f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kernel/liveupdate/kexec_handover.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,10 @@ int kho_preserve_vmalloc(void *ptr, struct kho_vmalloc *preservation)
10141014
chunk->phys[idx++] = phys;
10151015
if (idx == ARRAY_SIZE(chunk->phys)) {
10161016
chunk = new_vmalloc_chunk(chunk);
1017-
if (!chunk)
1017+
if (!chunk) {
1018+
err = -ENOMEM;
10181019
goto err_free;
1020+
}
10191021
idx = 0;
10201022
}
10211023
}

0 commit comments

Comments
 (0)