Skip to content

Commit

Permalink
spi: spi-nxp-fspi: Fix a NULL vs IS_ERR() check in probe
Browse files Browse the repository at this point in the history
The platform_get_resource_byname() function returns NULL on error, it
doesn't return error pointers.

Fixes: d166a73 ("spi: fspi: dynamically alloc AHB memory")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/20200312113154.GC20562@mwanda
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Dan Carpenter authored and broonie committed Mar 12, 2020
1 parent b562b30 commit 1a421eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-nxp-fspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)

/* find the resources - controller memory mapped space */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
if (IS_ERR(res)) {
ret = PTR_ERR(res);
if (!res) {
ret = -ENODEV;
goto err_put_ctrl;
}

Expand Down

0 comments on commit 1a421eb

Please sign in to comment.