Skip to content

Commit

Permalink
spi: stm32-ospi: Fix an IS_ERR() vs NULL bug in stm32_ospi_get_resour…
Browse files Browse the repository at this point in the history
…ces()

The devm_ioremap() function returns NULL on error, it doesn't return
error pointers.  Fix the check to match.

Fixes: 79b8a70 ("spi: stm32: Add OSPI driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://patch.msgid.link/bc4c9123-df43-4616-962f-765801d30b4c@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed Mar 6, 2025
1 parent 5fac6c2 commit 7dfc9bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-stm32-ospi.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,10 @@ static int stm32_ospi_get_resources(struct platform_device *pdev)
if (rmem) {
ospi->mm_size = rmem->size;
ospi->mm_base = devm_ioremap(dev, rmem->base, rmem->size);
if (IS_ERR(ospi->mm_base)) {
if (!ospi->mm_base) {
dev_err(dev, "unable to map memory region: %pa+%pa\n",
&rmem->base, &rmem->size);
ret = PTR_ERR(ospi->mm_base);
ret = -ENOMEM;
goto err_dma;
}

Expand Down

0 comments on commit 7dfc9bd

Please sign in to comment.