linux-aspeed.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
@ 2025-10-17 16:04 Dan Carpenter
  2025-10-17 18:28 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-10-17 16:04 UTC (permalink / raw)
  To: Chin-Ting Kuo
  Cc: Cédric Le Goater, Mark Brown, Joel Stanley, Andrew Jeffery,
	linux-aspeed, openbmc, linux-spi, linux-arm-kernel, linux-kernel,
	kernel-janitors

The platform_get_resource() function doesn't return error pointers, it
returns NULL on error.  Update the error checking to match.

Fixes: 64d87ccfae33 ("spi: aspeed: Only map necessary address window region")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/spi/spi-aspeed-smc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
index 0c3de371fd39..822df89cb787 100644
--- a/drivers/spi/spi-aspeed-smc.c
+++ b/drivers/spi/spi-aspeed-smc.c
@@ -865,9 +865,9 @@ static int aspeed_spi_probe(struct platform_device *pdev)
 		return PTR_ERR(aspi->regs);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (IS_ERR(res)) {
+	if (!res) {
 		dev_err(dev, "missing AHB memory\n");
-		return PTR_ERR(res);
+		return -EINVAL;
 	}
 
 	aspi->ahb_window_size = resource_size(res);
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH next] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
  2025-10-17 16:04 [PATCH next] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe() Dan Carpenter
@ 2025-10-17 18:28 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-10-17 18:28 UTC (permalink / raw)
  To: Chin-Ting Kuo, Dan Carpenter
  Cc: Cédric Le Goater, Joel Stanley, Andrew Jeffery, linux-aspeed,
	openbmc, linux-spi, linux-arm-kernel, linux-kernel,
	kernel-janitors

On Fri, 17 Oct 2025 19:04:34 +0300, Dan Carpenter wrote:
> The platform_get_resource() function doesn't return error pointers, it
> returns NULL on error.  Update the error checking to match.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
      commit: 0cc08c8130ac8f74419f99fe707dc193b7f79d86

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-17 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 16:04 [PATCH next] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe() Dan Carpenter
2025-10-17 18:28 ` Mark Brown

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).