Patch "spi: fix finalize message on error return" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    spi: fix finalize message on error return

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     spi-fix-finalize-message-on-error-return.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 614db1c2aeb592475e9d28fe2126d33f22797776
Author: David Lechner <dlechner@xxxxxxxxxxxx>
Date:   Thu Jan 25 14:53:09 2024 -0600

    spi: fix finalize message on error return
    
    [ Upstream commit 8c2ae772fe08e33f3d7a83849e85539320701abd ]
    
    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: ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync")
    Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
    Link: https://msgid.link/r/20240125205312.3458541-2-dlechner@xxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 8ead7acb99f3..4adc56dabf55 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1624,6 +1624,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,
 			pm_runtime_put_noidle(ctlr->dev.parent);
 			dev_err(&ctlr->dev, "Failed to power device: %d\n",
 				ret);
+
+			msg->status = ret;
+			spi_finalize_current_message(ctlr);
+
 			return ret;
 		}
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux