[PATCH] firmware: coreboot: Fix CFR error-pointer handling warning
From: Sean Rhodes
Date: Wed Oct 21 2026 - 03:55:54 EST
The scoped kfree cleanup already ignores error pointers, so passing the
pointer through no_free_ptr() before PTR_ERR() is unnecessary. It also
makes the IS_ERR/PTR_ERR expressions appear inconsistent to Coccinelle.
Return PTR_ERR() directly. The scoped cleanup still leaves error pointers
untouched while freeing successful allocations on later returns.
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/
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
drivers/firmware/coreboot/coreboot-cfr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/coreboot/coreboot-cfr.c
b/drivers/firmware/coreboot/coreboot-cfr.c
index 2d9ea5d213d8..61d5191b5447 100644
--- a/drivers/firmware/coreboot/coreboot-cfr.c
+++ b/drivers/firmware/coreboot/coreboot-cfr.c
@@ -341,7 +341,7 @@ static int coreboot_cfr_read_value(const struct
coreboot_cfr_setting *setting,
int ret;
if (IS_ERR(efi_name))
- return PTR_ERR(no_free_ptr(efi_name));
+ return PTR_ERR(efi_name);
ret = efivar_lock();
if (ret)
--
2.53.0