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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Reviewed-by: Pasha Tatashin <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Reviewed-by: Mike Rapoport (Microsoft) <[email protected]> Cc: Alexander Graf <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Pasha Tatashin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
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)