* [PATCH net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware()
@ 2025-07-15 23:01 Dan Carpenter
2025-07-16 7:17 ` Lorenzo Bianconi
2025-07-18 2:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-07-15 23:01 UTC (permalink / raw)
To: Rob Herring
Cc: Lorenzo Bianconi, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-arm-kernel, linux-mediatek,
netdev, linux-kernel, kernel-janitors
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>
---
drivers/net/ethernet/airoha/airoha_npu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c
index 4e8deb87f751..5b0f66e9cdae 100644
--- a/drivers/net/ethernet/airoha/airoha_npu.c
+++ b/drivers/net/ethernet/airoha/airoha_npu.c
@@ -179,8 +179,8 @@ static int airoha_npu_run_firmware(struct device *dev, void __iomem *base,
}
addr = devm_ioremap_resource(dev, res);
- if (!addr) {
- ret = -ENOMEM;
+ if (IS_ERR(addr)) {
+ ret = PTR_ERR(addr);
goto out;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware()
2025-07-15 23:01 [PATCH net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware() Dan Carpenter
@ 2025-07-16 7:17 ` Lorenzo Bianconi
2025-07-18 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2025-07-16 7:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Rob Herring, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-arm-kernel, linux-mediatek,
netdev, linux-kernel, kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
> The devm_ioremap_resource() function returns error pointers. It never
> returns NULL. Update the check to match.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Fixes: e27dba1951ce ("net: Use of_reserved_mem_region_to_resource{_byname}() for "memory-region"")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/net/ethernet/airoha/airoha_npu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c
> index 4e8deb87f751..5b0f66e9cdae 100644
> --- a/drivers/net/ethernet/airoha/airoha_npu.c
> +++ b/drivers/net/ethernet/airoha/airoha_npu.c
> @@ -179,8 +179,8 @@ static int airoha_npu_run_firmware(struct device *dev, void __iomem *base,
> }
>
> addr = devm_ioremap_resource(dev, res);
> - if (!addr) {
> - ret = -ENOMEM;
> + if (IS_ERR(addr)) {
> + ret = PTR_ERR(addr);
> goto out;
> }
>
> --
> 2.47.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware()
2025-07-15 23:01 [PATCH net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware() Dan Carpenter
2025-07-16 7:17 ` Lorenzo Bianconi
@ 2025-07-18 2:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-18 2:00 UTC (permalink / raw)
To: Dan Carpenter
Cc: robh, lorenzo, andrew+netdev, davem, edumazet, kuba, pabeni,
linux-arm-kernel, linux-mediatek, netdev, linux-kernel,
kernel-janitors
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 15 Jul 2025 18:01:10 -0500 you wrote:
> 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>
> ---
> drivers/net/ethernet/airoha/airoha_npu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- [net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware()
https://git.kernel.org/netdev/net-next/c/1e5e40f2558c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-18 2:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 23:01 [PATCH net-next] net: airoha: Fix a NULL vs IS_ERR() bug in airoha_npu_run_firmware() Dan Carpenter
2025-07-16 7:17 ` Lorenzo Bianconi
2025-07-18 2:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).