Skip to content

Commit 0169a24

Browse files
Dan Carpenterkrzk
authored andcommitted
memory: stm32_omm: Fix NULL vs IS_ERR() check in probe()
The platform_get_resource_byname() function returns NULL on error. It doesn't return error pointers. Update the check to match. Fixes: 8181d06 ("memory: Add STM32 Octo Memory Manager driver") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/a1645f1eedaa9b2ae62ac07feed0552eea75bc46.1746781081.git.dan.carpenter@linaro.org Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent d44eeb2 commit 0169a24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/memory/stm32_omm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ static int stm32_omm_probe(struct platform_device *pdev)
320320
return PTR_ERR(omm->io_base);
321321

322322
omm->mm_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory_map");
323-
if (IS_ERR(omm->mm_res))
324-
return PTR_ERR(omm->mm_res);
323+
if (!omm->mm_res)
324+
return -ENODEV;
325325

326326
/* check child's access */
327327
for_each_child_of_node_scoped(dev->of_node, child) {

0 commit comments

Comments
 (0)