Message ID | 20230720140859.33883-1-ruc_gongyuanjun@163.com |
---|---|
State | Accepted |
Commit | 1e7dae68510aa90a022fefed392fa794b16bc68b |
Headers | show |
Series | [1/1] spi: fix return value check in bcm2835_spi_probe() | expand |
On Thu, 20 Jul 2023 22:08:59 +0800, Yuanjun Gong wrote: > in bcm2835_spi_probe(), clk_prepare_enable() may fail, therefore, > the return value of clk_prepare_enable() should be checked, and > the function should return error if clk_prepare_enable() fails. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/1] spi: fix return value check in bcm2835_spi_probe() commit: 1e7dae68510aa90a022fefed392fa794b16bc68b 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
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 3b253da98c05..7dfa1b3bd069 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1363,7 +1363,9 @@ static int bcm2835_spi_probe(struct platform_device *pdev) if (bs->irq <= 0) return bs->irq ? bs->irq : -ENODEV; - clk_prepare_enable(bs->clk); + err = clk_prepare_enable(bs->clk); + if (err) + return err; bs->clk_hz = clk_get_rate(bs->clk); err = bcm2835_dma_init(ctlr, &pdev->dev, bs);
in bcm2835_spi_probe(), clk_prepare_enable() may fail, therefore, the return value of clk_prepare_enable() should be checked, and the function should return error if clk_prepare_enable() fails. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> --- drivers/spi/spi-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)