0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-10-31 20:18:35 +00:00
Files
openwrt/target/linux/airoha/patches-6.12/101-v6.17-net-airoha-Fix-a-NULL-vs-IS_ERR-bug-in-airoha_npu_ru.patch
Christian Marangi 8b4adfbb87 airoha: backport additional upstream patch for NPU support for AN7583
Backport additional patch required for NPU support of Airoha AN7583.
These are specific for the NPU module with some minor fixes and to adds
upport for loading the specific Airoha AN7583 NPU firmware.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-10-23 16:54:45 +02:00

32 lines
1.1 KiB
Diff

From 1e5e40f2558c07f6bc60a8983000309cc0a9d600 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@linaro.org>
Date: Tue, 15 Jul 2025 18:01:10 -0500
Subject: [PATCH] net: airoha: Fix a NULL vs IS_ERR() bug in
airoha_npu_run_firmware()
The devm_ioremap_resource() function returns error pointers. It never
returns NULL. Update the check to match.
Fixes: e27dba1951ce ("net: Use of_reserved_mem_region_to_resource{_byname}() for "memory-region"")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/fc6d194e-6bf5-49ca-bc77-3fdfda62c434@sabinyo.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/airoha/airoha_npu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/airoha/airoha_npu.c
+++ b/drivers/net/ethernet/airoha/airoha_npu.c
@@ -201,8 +201,8 @@ static int airoha_npu_run_firmware(struc
}
addr = devm_ioremap(dev, rmem->base, rmem->size);
- if (!addr) {
- ret = -ENOMEM;
+ if (IS_ERR(addr)) {
+ ret = PTR_ERR(addr);
goto out;
}