Lines Matching refs:ret
42 int ret = -ENOEXEC; in kexec_image_probe_default() local
45 ret = (*fops)->probe(buf, buf_len); in kexec_image_probe_default()
46 if (!ret) { in kexec_image_probe_default()
48 return ret; in kexec_image_probe_default()
52 return ret; in kexec_image_probe_default()
185 int ret; in kimage_validate_signature() local
187 ret = arch_kexec_kernel_verify_sig(image, image->kernel_buf, in kimage_validate_signature()
189 switch (ret) { in kimage_validate_signature()
208 return ret; in kimage_validate_signature()
226 pr_notice("kernel signature verification failed (%d).\n", ret); in kimage_validate_signature()
229 return ret; in kimage_validate_signature()
242 int ret; in kimage_file_prepare_segments() local
246 ret = kernel_read_file_from_fd(kernel_fd, &image->kernel_buf, in kimage_file_prepare_segments()
248 if (ret) in kimage_file_prepare_segments()
249 return ret; in kimage_file_prepare_segments()
253 ret = arch_kexec_kernel_image_probe(image, image->kernel_buf, in kimage_file_prepare_segments()
255 if (ret) in kimage_file_prepare_segments()
259 ret = kimage_validate_signature(image); in kimage_file_prepare_segments()
261 if (ret) in kimage_file_prepare_segments()
266 ret = kernel_read_file_from_fd(initrd_fd, &image->initrd_buf, in kimage_file_prepare_segments()
269 if (ret) in kimage_file_prepare_segments()
277 ret = PTR_ERR(image->cmdline_buf); in kimage_file_prepare_segments()
286 ret = -EINVAL; in kimage_file_prepare_segments()
301 ret = PTR_ERR(ldata); in kimage_file_prepare_segments()
308 if (ret) in kimage_file_prepare_segments()
310 return ret; in kimage_file_prepare_segments()
318 int ret; in kimage_file_alloc_init() local
334 ret = kimage_file_prepare_segments(image, kernel_fd, initrd_fd, in kimage_file_alloc_init()
336 if (ret) in kimage_file_alloc_init()
339 ret = sanity_check_segment_list(image); in kimage_file_alloc_init()
340 if (ret) in kimage_file_alloc_init()
343 ret = -ENOMEM; in kimage_file_alloc_init()
367 return ret; in kimage_file_alloc_init()
374 int ret = 0, i; in SYSCALL_DEFINE5() local
408 ret = kimage_file_alloc_init(&image, kernel_fd, initrd_fd, cmdline_ptr, in SYSCALL_DEFINE5()
410 if (ret) in SYSCALL_DEFINE5()
413 ret = machine_kexec_prepare(image); in SYSCALL_DEFINE5()
414 if (ret) in SYSCALL_DEFINE5()
421 ret = kimage_crash_copy_vmcoreinfo(image); in SYSCALL_DEFINE5()
422 if (ret) in SYSCALL_DEFINE5()
425 ret = kexec_calculate_store_digests(image); in SYSCALL_DEFINE5()
426 if (ret) in SYSCALL_DEFINE5()
437 ret = kimage_load_segment(image, &image->segment[i]); in SYSCALL_DEFINE5()
438 if (ret) in SYSCALL_DEFINE5()
457 return ret; in SYSCALL_DEFINE5()
558 int ret = 0; in kexec_walk_memblock() local
576 ret = func(&res, kbuf); in kexec_walk_memblock()
577 if (ret) in kexec_walk_memblock()
590 ret = func(&res, kbuf); in kexec_walk_memblock()
591 if (ret) in kexec_walk_memblock()
596 return ret; in kexec_walk_memblock()
637 int ret; in kexec_locate_mem_hole() local
644 ret = kexec_walk_resources(kbuf, locate_mem_hole_callback); in kexec_locate_mem_hole()
646 ret = kexec_walk_memblock(kbuf, locate_mem_hole_callback); in kexec_locate_mem_hole()
648 return ret == 1 ? 0 : -EADDRNOTAVAIL; in kexec_locate_mem_hole()
665 int ret; in kexec_add_buffer() local
691 ret = kexec_locate_mem_hole(kbuf); in kexec_add_buffer()
692 if (ret) in kexec_add_buffer()
693 return ret; in kexec_add_buffer()
710 int ret = 0, i, j, zero_buf_sz, sha_region_sz; in kexec_calculate_store_digests() local
725 ret = PTR_ERR(tfm); in kexec_calculate_store_digests()
732 ret = -ENOMEM; in kexec_calculate_store_digests()
743 ret = crypto_shash_init(desc); in kexec_calculate_store_digests()
744 if (ret < 0) in kexec_calculate_store_digests()
749 ret = -ENOMEM; in kexec_calculate_store_digests()
764 ret = crypto_shash_update(desc, ksegment->kbuf, in kexec_calculate_store_digests()
766 if (ret) in kexec_calculate_store_digests()
779 ret = crypto_shash_update(desc, zero_buf, bytes); in kexec_calculate_store_digests()
780 if (ret) in kexec_calculate_store_digests()
785 if (ret) in kexec_calculate_store_digests()
793 if (!ret) { in kexec_calculate_store_digests()
794 ret = crypto_shash_final(desc, digest); in kexec_calculate_store_digests()
795 if (ret) in kexec_calculate_store_digests()
797 ret = kexec_purgatory_get_set_symbol(image, "purgatory_sha_regions", in kexec_calculate_store_digests()
799 if (ret) in kexec_calculate_store_digests()
802 ret = kexec_purgatory_get_set_symbol(image, "purgatory_sha256_digest", in kexec_calculate_store_digests()
804 if (ret) in kexec_calculate_store_digests()
817 return ret; in kexec_calculate_store_digests()
838 int i, ret; in kexec_purgatory_setup_kbuf() local
871 ret = kexec_add_buffer(kbuf); in kexec_purgatory_setup_kbuf()
872 if (ret) in kexec_purgatory_setup_kbuf()
879 return ret; in kexec_purgatory_setup_kbuf()
953 int i, ret; in kexec_apply_relocations() local
999 ret = arch_kexec_apply_relocations_add(pi, section, in kexec_apply_relocations()
1002 ret = arch_kexec_apply_relocations(pi, section, in kexec_apply_relocations()
1004 if (ret) in kexec_apply_relocations()
1005 return ret; in kexec_apply_relocations()
1025 int ret; in kexec_load_purgatory() local
1032 ret = kexec_purgatory_setup_kbuf(pi, kbuf); in kexec_load_purgatory()
1033 if (ret) in kexec_load_purgatory()
1034 return ret; in kexec_load_purgatory()
1036 ret = kexec_purgatory_setup_sechdrs(pi, kbuf); in kexec_load_purgatory()
1037 if (ret) in kexec_load_purgatory()
1040 ret = kexec_apply_relocations(image); in kexec_load_purgatory()
1041 if (ret) in kexec_load_purgatory()
1051 return ret; in kexec_load_purgatory()