mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-28 16:53:49 +00:00
spi: aspeed: Fix an error handling path in aspeed_spi_[read|write]_user()
A aspeed_spi_start_user() is not balanced by a corresponding
aspeed_spi_stop_user().
Add the missing call.
Fixes: e3228ed928
("spi: spi-mem: Convert Aspeed SMC driver to spi-mem")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/4052aa2f9a9ea342fa6af83fa991b55ce5d5819e.1732051814.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
fac04efc5c
commit
c84dda3751
@ -239,7 +239,7 @@ static ssize_t aspeed_spi_read_user(struct aspeed_spi_chip *chip,
|
||||
|
||||
ret = aspeed_spi_send_cmd_addr(chip, op->addr.nbytes, offset, op->cmd.opcode);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto stop_user;
|
||||
|
||||
if (op->dummy.buswidth && op->dummy.nbytes) {
|
||||
for (i = 0; i < op->dummy.nbytes / op->dummy.buswidth; i++)
|
||||
@ -249,8 +249,9 @@ static ssize_t aspeed_spi_read_user(struct aspeed_spi_chip *chip,
|
||||
aspeed_spi_set_io_mode(chip, io_mode);
|
||||
|
||||
aspeed_spi_read_from_ahb(buf, chip->ahb_base, len);
|
||||
stop_user:
|
||||
aspeed_spi_stop_user(chip);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t aspeed_spi_write_user(struct aspeed_spi_chip *chip,
|
||||
@ -261,10 +262,11 @@ static ssize_t aspeed_spi_write_user(struct aspeed_spi_chip *chip,
|
||||
aspeed_spi_start_user(chip);
|
||||
ret = aspeed_spi_send_cmd_addr(chip, op->addr.nbytes, op->addr.val, op->cmd.opcode);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto stop_user;
|
||||
aspeed_spi_write_to_ahb(chip->ahb_base, op->data.buf.out, op->data.nbytes);
|
||||
stop_user:
|
||||
aspeed_spi_stop_user(chip);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* support for 1-1-1, 1-1-2 or 1-1-4 */
|
||||
|
Loading…
Reference in New Issue
Block a user