Skip to content

Commit 8c2ae77

Browse files
dlechbroonie
authored andcommitted
spi: fix finalize message on error return
In __spi_pump_transfer_message(), the message was not finalized in the first error return as it is in the other error return paths. Not finalizing the message could cause anything waiting on the message to complete to hang forever. This adds the missing call to spi_finalize_current_message(). Fixes: ae7d234 ("spi: Don't use the message queue if possible in spi_sync") Signed-off-by: David Lechner <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f9f4b0c commit 8c2ae77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/spi/spi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,
17171717
pm_runtime_put_noidle(ctlr->dev.parent);
17181718
dev_err(&ctlr->dev, "Failed to power device: %d\n",
17191719
ret);
1720+
1721+
msg->status = ret;
1722+
spi_finalize_current_message(ctlr);
1723+
17201724
return ret;
17211725
}
17221726
}

0 commit comments

Comments
 (0)