drivers/firmware/efi/ovmf-debug-log.c:94 ovmf_log_probe() warn: missing unwind goto?

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Gerd Hoffmann <[email protected]>
CC: Ard Biesheuvel <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   94515f3a7d4256a5062176b7d6ed0471938cd51a
commit: f393a761763c542761abcf978252d431269366d6 efi: add ovmf debug log driver
date:   1 year ago
:::::: branch date: 17 hours ago
:::::: commit date: 1 year ago
config: x86_64-randconfig-161-20260716 (https://download.01.org/0day-ci/archive/20260718/[email protected]/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
smatch: v0.5.0-9185-gbcc58b9c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: f393a761763c ("efi: add ovmf debug log driver")
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/firmware/efi/ovmf-debug-log.c:94 ovmf_log_probe() warn: missing unwind goto?

vim +94 drivers/firmware/efi/ovmf-debug-log.c

f393a761763c54 Gerd Hoffmann 2025-07-08  66  
f393a761763c54 Gerd Hoffmann 2025-07-08  67  int __init ovmf_log_probe(unsigned long ovmf_debug_log_table)
f393a761763c54 Gerd Hoffmann 2025-07-08  68  {
f393a761763c54 Gerd Hoffmann 2025-07-08  69  	int ret = -EINVAL;
f393a761763c54 Gerd Hoffmann 2025-07-08  70  	u64 size;
f393a761763c54 Gerd Hoffmann 2025-07-08  71  
f393a761763c54 Gerd Hoffmann 2025-07-08  72  	/* map + verify header */
f393a761763c54 Gerd Hoffmann 2025-07-08  73  	hdr = memremap(ovmf_debug_log_table, sizeof(*hdr), MEMREMAP_WB);
f393a761763c54 Gerd Hoffmann 2025-07-08  74  	if (!hdr) {
f393a761763c54 Gerd Hoffmann 2025-07-08  75  		pr_err("OVMF debug log: header map failed\n");
f393a761763c54 Gerd Hoffmann 2025-07-08  76  		return -EINVAL;
f393a761763c54 Gerd Hoffmann 2025-07-08  77  	}
f393a761763c54 Gerd Hoffmann 2025-07-08  78  
f393a761763c54 Gerd Hoffmann 2025-07-08  79  	if (hdr->magic1 != OVMF_DEBUG_LOG_MAGIC1 ||
f393a761763c54 Gerd Hoffmann 2025-07-08  80  	    hdr->magic2 != OVMF_DEBUG_LOG_MAGIC2) {
f393a761763c54 Gerd Hoffmann 2025-07-08  81  		printk(KERN_ERR "OVMF debug log: magic mismatch\n");
f393a761763c54 Gerd Hoffmann 2025-07-08  82  		goto err_unmap;
f393a761763c54 Gerd Hoffmann 2025-07-08  83  	}
f393a761763c54 Gerd Hoffmann 2025-07-08  84  
f393a761763c54 Gerd Hoffmann 2025-07-08  85  	size = hdr->hdr_size + hdr->log_size;
f393a761763c54 Gerd Hoffmann 2025-07-08  86  	pr_info("OVMF debug log: firmware version: \"%s\"\n", hdr->fw_version);
f393a761763c54 Gerd Hoffmann 2025-07-08  87  	pr_info("OVMF debug log: buffer size: %lluk\n", size / 1024);
f393a761763c54 Gerd Hoffmann 2025-07-08  88  
f393a761763c54 Gerd Hoffmann 2025-07-08  89  	/* map complete log buffer */
f393a761763c54 Gerd Hoffmann 2025-07-08  90  	memunmap(hdr);
f393a761763c54 Gerd Hoffmann 2025-07-08  91  	hdr = memremap(ovmf_debug_log_table, size, MEMREMAP_WB);
f393a761763c54 Gerd Hoffmann 2025-07-08  92  	if (!hdr) {
f393a761763c54 Gerd Hoffmann 2025-07-08  93  		pr_err("OVMF debug log: buffer map failed\n");
f393a761763c54 Gerd Hoffmann 2025-07-08 @94  		return -EINVAL;

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.