spi: Release spi_res after finalizing message

spi_split_transfers_maxsize() can be used to split a transfer. This
function uses spi_res to lifetime manage the added transfer structures.
So in order to finalize the current message while it contains the split
transfers, spi_res_release() must be called after finalizing.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Noralf Trønnes 2019-04-13 20:24:13 +02:00 committed by Mark Brown
parent 4d1841d645
commit c9ba7a16d0
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -1181,10 +1181,10 @@ static int spi_transfer_one_message(struct spi_controller *ctlr,
if (msg->status && ctlr->handle_err)
ctlr->handle_err(ctlr, msg);
spi_res_release(ctlr, msg);
spi_finalize_current_message(ctlr);
spi_res_release(ctlr, msg);
return ret;
}