Commit 56ec4562 authored by Patrice Chotard's avatar Patrice Chotard Committed by Mark Brown

spi: stm32-qspi: Fix stm32_qspi_transfer_one_message() error path

The patch a557fca6: "spi: stm32_qspi: Add transfer_one_message()
spi callback" from Aug 23, 2022, leads to the following Smatch static
checker warning:

drivers/spi/spi-stm32-qspi.c:627 stm32_qspi_transfer_one_message()
error: uninitialized symbol 'ret'.Fix the following Smatch static checker warning:

Fixes: a557fca6 ("spi: stm32_qspi: Add transfer_one_message() spi callback")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20220826092031.1393430-1-patrice.chotard@foss.st.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3fe26121
...@@ -562,7 +562,7 @@ static int stm32_qspi_transfer_one_message(struct spi_controller *ctrl, ...@@ -562,7 +562,7 @@ static int stm32_qspi_transfer_one_message(struct spi_controller *ctrl,
struct spi_transfer *transfer; struct spi_transfer *transfer;
struct spi_device *spi = msg->spi; struct spi_device *spi = msg->spi;
struct spi_mem_op op; struct spi_mem_op op;
int ret; int ret = 0;
if (!spi->cs_gpiod) if (!spi->cs_gpiod)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -592,8 +592,10 @@ static int stm32_qspi_transfer_one_message(struct spi_controller *ctrl, ...@@ -592,8 +592,10 @@ static int stm32_qspi_transfer_one_message(struct spi_controller *ctrl,
dummy_bytes = transfer->len; dummy_bytes = transfer->len;
/* if happens, means that message is not correctly built */ /* if happens, means that message is not correctly built */
if (list_is_last(&transfer->transfer_list, &msg->transfers)) if (list_is_last(&transfer->transfer_list, &msg->transfers)) {
ret = -EINVAL;
goto end_of_transfer; goto end_of_transfer;
}
transfer = list_next_entry(transfer, transfer_list); transfer = list_next_entry(transfer, transfer_list);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment