未验证 提交 73f93db5 编写于 作者: P Paul Kocialkowski 提交者: Mark Brown

spi: core: Initialize returned status in spi_setup

The previous commit that made bits-per-word validation conditional
results in leaving no unconditional affectation of the status variable.

Since the variable is returned at the end of the function, initialize
it to avoid returning an undefined value.
Signed-off-by: NPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Fixes: b3fe2e51 ("spi: core: Only check bits_per_word validity when explicitly provided")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220414084040.975520-1-paul.kocialkowski@bootlin.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 e7cc4244
......@@ -3474,7 +3474,7 @@ static int __spi_validate_bits_per_word(struct spi_controller *ctlr,
int spi_setup(struct spi_device *spi)
{
unsigned bad_bits, ugly_bits;
int status;
int status = 0;
/*
* Check mode to prevent that any two of DUAL, QUAD and NO_MOSI/MISO
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册