* [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto
@ 2026-07-16 8:25 Praveen Talari
2026-07-16 9:36 ` Konrad Dybcio
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Praveen Talari @ 2026-07-16 8:25 UTC (permalink / raw)
To: Mark Brown, Rafael J. Wysocki (Intel), Konrad Dybcio
Cc: linux-arm-msm, linux-spi, linux-kernel, Mukesh Kumar Savaliya,
kernel test robot, Dan Carpenter, Praveen Talari
spi_geni_init() reuses 'ret' after it has already been set by the
runtime PM acquire check earlier in the function. When an invalid
protocol is later detected, the function returns this stale 'ret'
value instead of a proper error code, so it can end up returning 0
(or some other non-error value) even though the protocol check
failed.
Fix this by returning -EINVAL directly on both invalid-proto paths.
Fixes: d8e9ea989acb ("spi: qcom-geni: Fix missing error check on pm_runtime_get_sync()")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202607122241.qzP3QAXF-lkp@intel.com/
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
---
drivers/spi/spi-geni-qcom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 2914d781dbf5..d262206ed663 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -634,7 +634,7 @@ static int spi_geni_init(struct spi_geni_master *mas)
if (spi->target) {
if (proto != GENI_SE_SPI_SLAVE) {
dev_err(mas->dev, "Invalid proto %d\n", proto);
- return ret;
+ return -EINVAL;
}
spi_slv_setup(mas);
} else if (proto == GENI_SE_INVALID_PROTO) {
@@ -645,7 +645,7 @@ static int spi_geni_init(struct spi_geni_master *mas)
}
} else if (proto != GENI_SE_SPI) {
dev_err(mas->dev, "Invalid proto %d\n", proto);
- return ret;
+ return -EINVAL;
}
mas->tx_fifo_depth = geni_se_get_tx_fifo_depth(se);
---
base-commit: cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5
change-id: 20260716-fix_return_error_code-d1a794620d0f
Best regards,
--
Praveen Talari <praveen.talari@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto
2026-07-16 8:25 [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto Praveen Talari
@ 2026-07-16 9:36 ` Konrad Dybcio
2026-07-16 10:10 ` Mukesh Savaliya
2026-07-16 15:58 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2026-07-16 9:36 UTC (permalink / raw)
To: Praveen Talari, Mark Brown, Rafael J. Wysocki (Intel)
Cc: linux-arm-msm, linux-spi, linux-kernel, Mukesh Kumar Savaliya,
kernel test robot, Dan Carpenter
On 7/16/26 10:25 AM, Praveen Talari wrote:
> spi_geni_init() reuses 'ret' after it has already been set by the
> runtime PM acquire check earlier in the function. When an invalid
> protocol is later detected, the function returns this stale 'ret'
> value instead of a proper error code, so it can end up returning 0
> (or some other non-error value) even though the protocol check
> failed.
>
> Fix this by returning -EINVAL directly on both invalid-proto paths.
>
> Fixes: d8e9ea989acb ("spi: qcom-geni: Fix missing error check on pm_runtime_get_sync()")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202607122241.qzP3QAXF-lkp@intel.com/
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto
2026-07-16 8:25 [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto Praveen Talari
2026-07-16 9:36 ` Konrad Dybcio
@ 2026-07-16 10:10 ` Mukesh Savaliya
2026-07-16 15:58 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mukesh Savaliya @ 2026-07-16 10:10 UTC (permalink / raw)
To: Praveen Talari, Mark Brown, Rafael J. Wysocki (Intel), Konrad Dybcio
Cc: linux-arm-msm, linux-spi, linux-kernel, kernel test robot, Dan Carpenter
On 7/16/2026 1:55 PM, Praveen Talari wrote:
> spi_geni_init() reuses 'ret' after it has already been set by the
> runtime PM acquire check earlier in the function. When an invalid
> protocol is later detected, the function returns this stale 'ret'
> value instead of a proper error code, so it can end up returning 0
> (or some other non-error value) even though the protocol check
> failed.
>
> Fix this by returning -EINVAL directly on both invalid-proto paths.
>
> Fixes: d8e9ea989acb ("spi: qcom-geni: Fix missing error check on pm_runtime_get_sync()")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202607122241.qzP3QAXF-lkp@intel.com/
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
> ---
> drivers/spi/spi-geni-qcom.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto
2026-07-16 8:25 [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto Praveen Talari
2026-07-16 9:36 ` Konrad Dybcio
2026-07-16 10:10 ` Mukesh Savaliya
@ 2026-07-16 15:58 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-07-16 15:58 UTC (permalink / raw)
To: Rafael J. Wysocki (Intel), Konrad Dybcio, Praveen Talari
Cc: linux-arm-msm, linux-spi, linux-kernel, Mukesh Kumar Savaliya,
kernel test robot, Dan Carpenter
On Thu, 16 Jul 2026 13:55:45 +0530, Praveen Talari wrote:
> spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.3
Thanks!
[1/1] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto
https://git.kernel.org/broonie/spi/c/2c1c13da3a3a
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-18 0:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-16 8:25 [PATCH] spi: geni-qcom: Fix sticky ret causing wrong return value on invalid proto Praveen Talari
2026-07-16 9:36 ` Konrad Dybcio
2026-07-16 10:10 ` Mukesh Savaliya
2026-07-16 15:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox