drivers/firmware/coreboot/coreboot-cfr.c:343:5-11: inconsistent IS_ERR and PTR_ERR on line 344.

From: kernel test robot

Date: Wed Oct 21 2026 - 00:30:55 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 72a16bcff25e9f4a1d6d42a243301b1b76db2f32
commit: f2e05ce9763feb1dd7da15afd2cc61df227ee85a firmware: coreboot: Add CFR firmware attributes driver
date: 3 weeks ago
config: i386-randconfig-r2106-20261021 (https://download.01.org/0day-ci/archive/20261021/202610210637.LiJ3U0ob-lkp@xxxxxxxxx/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0

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: f2e05ce9763f ("firmware: coreboot: Add CFR firmware attributes driver")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610210637.LiJ3U0ob-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> drivers/firmware/coreboot/coreboot-cfr.c:343:5-11: inconsistent IS_ERR and PTR_ERR on line 344.

vim +343 drivers/firmware/coreboot/coreboot-cfr.c

335
336 static int coreboot_cfr_read_value(const struct coreboot_cfr_setting *setting,
337 u32 *value, u32 *attrs)
338 {
339 efi_char16_t *efi_name __free(kfree) =
340 coreboot_cfr_efi_name(setting->name);
341 int ret;
342
> 343 if (IS_ERR(efi_name))
> 344 return PTR_ERR(no_free_ptr(efi_name));
345
346 ret = efivar_lock();
347 if (ret)
348 return ret;
349
350 ret = coreboot_cfr_read_efi_value(efi_name, value, attrs);
351 efivar_unlock();
352
353 return ret;
354 }
355

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki