From: Dan Carpenter <dan.carpenter@linaro.org>
To: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Christophe Kerello <christophe.kerello@foss.st.com>,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] memory: stm32_omm: Fix NULL vs IS_ERR() check in probe()
Date: Fri, 9 May 2025 14:04:37 +0300 [thread overview]
Message-ID: <a1645f1eedaa9b2ae62ac07feed0552eea75bc46.1746781081.git.dan.carpenter@linaro.org> (raw)
In-Reply-To: <cover.1746781081.git.dan.carpenter@linaro.org>
The platform_get_resource_byname() function returns NULL on error. It
doesn't return error pointers. Update the check to match.
Fixes: 8181d061dcff ("memory: Add STM32 Octo Memory Manager driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/memory/stm32_omm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/stm32_omm.c b/drivers/memory/stm32_omm.c
index fa0f75e4a6e8..c8de785401f2 100644
--- a/drivers/memory/stm32_omm.c
+++ b/drivers/memory/stm32_omm.c
@@ -320,8 +320,8 @@ static int stm32_omm_probe(struct platform_device *pdev)
return PTR_ERR(omm->io_base);
omm->mm_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory_map");
- if (IS_ERR(omm->mm_res))
- return PTR_ERR(omm->mm_res);
+ if (!omm->mm_res)
+ return -ENODEV;
/* check child's access */
for_each_child_of_node_scoped(dev->of_node, child) {
--
2.47.2
next prev parent reply other threads:[~2025-05-09 11:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-09 11:04 [PATCH 0/2] memory: stm32_omm: Fix error handling bugs Dan Carpenter
2025-05-09 11:04 ` [PATCH 1/2] memory: stm32_omm: Fix error handling in stm32_omm_configure() Dan Carpenter
2025-05-09 11:04 ` Dan Carpenter [this message]
2025-05-12 6:38 ` [PATCH 0/2] memory: stm32_omm: Fix error handling bugs Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1645f1eedaa9b2ae62ac07feed0552eea75bc46.1746781081.git.dan.carpenter@linaro.org \
--to=dan.carpenter@linaro.org \
--cc=alexandre.torgue@foss.st.com \
--cc=christophe.kerello@foss.st.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=patrice.chotard@foss.st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®