Skip to content

Commit 1e5e40f

Browse files
Dan Carpenterkuba-moo
authored andcommitted
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: e27dba1 ("net: Use of_reserved_mem_region_to_resource{_byname}() for "memory-region"") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Lorenzo Bianconi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 687678f commit 1e5e40f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/airoha/airoha_npu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ static int airoha_npu_run_firmware(struct device *dev, void __iomem *base,
179179
}
180180

181181
addr = devm_ioremap_resource(dev, res);
182-
if (!addr) {
183-
ret = -ENOMEM;
182+
if (IS_ERR(addr)) {
183+
ret = PTR_ERR(addr);
184184
goto out;
185185
}
186186

0 commit comments

Comments
 (0)