Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: amlogic-spifc-a1: Handle devm_pm_runtime_enable() errors

devm_pm_runtime_enable() can fail due to memory allocation. The current
code ignores its return value, potentially causing runtime PM operations
to fail silently after autosuspend configuration.

Check the return value of devm_pm_runtime_enable() and return on failure.

Fixes: 909fac05b926 ("spi: add support for Amlogic A1 SPI Flash Controller")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20251124015852.937-1-vulab@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Haotian Zhang and committed by
Mark Brown
a90903c2 9f0c21ba

+3 -1
+3 -1
drivers/spi/spi-amlogic-spifc-a1.c
··· 353 353 354 354 pm_runtime_set_autosuspend_delay(spifc->dev, 500); 355 355 pm_runtime_use_autosuspend(spifc->dev); 356 - devm_pm_runtime_enable(spifc->dev); 356 + ret = devm_pm_runtime_enable(spifc->dev); 357 + if (ret) 358 + return ret; 357 359 358 360 ctrl->num_chipselect = 1; 359 361 ctrl->dev.of_node = pdev->dev.of_node;