diff options
author | Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> | 2021-10-25 21:56:27 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-10-26 20:04:00 +0100 |
commit | 0b0a281ed7001d4c4f4c47bdc84680c4997761ca (patch) | |
tree | 169bbff2c6a78dc94af66109f03f67bb2cadf390 /drivers/spi/spi-rpc-if.c | |
parent | 134a72373f7ce56a36726ebb525ff9f6c009dbe3 (diff) | |
download | linux-next-0b0a281ed7001d4c4f4c47bdc84680c4997761ca.tar.gz |
spi: spi-rpc-if: Check return value of rpcif_sw_init()
rpcif_sw_init() can fail so make sure we check the return value
of it and on error exit rpcif_spi_probe() callback with error code.
Fixes: eb8d6d464a27 ("spi: add Renesas RPC-IF driver")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20211025205631.21151-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rpc-if.c')
-rw-r--r-- | drivers/spi/spi-rpc-if.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c index c53138ce0030..83796a4ead34 100644 --- a/drivers/spi/spi-rpc-if.c +++ b/drivers/spi/spi-rpc-if.c @@ -139,7 +139,9 @@ static int rpcif_spi_probe(struct platform_device *pdev) return -ENOMEM; rpc = spi_controller_get_devdata(ctlr); - rpcif_sw_init(rpc, parent); + error = rpcif_sw_init(rpc, parent); + if (error) + return error; platform_set_drvdata(pdev, ctlr); |