Skip to content

Commit c86a918

Browse files
dlechbroonie
authored andcommitted
spi: don't unoptimize message in spi_async()
Calling spi_maybe_unoptimize_message() in spi_async() is wrong because the message is likely to be in the queue and not transferred yet. This can corrupt the message while it is being used by the controller driver. spi_maybe_unoptimize_message() is already called in the correct place in spi_finalize_current_message() to balance the call to spi_maybe_optimize_message() in spi_async(). Fixes: 7b1d87a ("spi: add spi_optimize_message() APIs") Signed-off-by: David Lechner <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8221545 commit c86a918

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/spi/spi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4432,8 +4432,6 @@ int spi_async(struct spi_device *spi, struct spi_message *message)
44324432

44334433
spin_unlock_irqrestore(&ctlr->bus_lock_spinlock, flags);
44344434

4435-
spi_maybe_unoptimize_message(message);
4436-
44374435
return ret;
44384436
}
44394437
EXPORT_SYMBOL_GPL(spi_async);

0 commit comments

Comments
 (0)