[PATCH 0/3] spi: imx: Three fixes for the i.MX SPI driver

John Madieu posted 3 patches 1 month, 1 week ago
drivers/spi/spi-imx.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH 0/3] spi: imx: Three fixes for the i.MX SPI driver
Posted by John Madieu 1 month, 1 week ago
Hi All,

This series independent fixes found in the i.MX SPI driver.

These are:

1/3 fixes a precedence bug in spi_imx_dma_max_wml_find() that makes
    the watermark-finding logic effectively dead code. The function
    currently always returns wml = 1 because of how the !-operator
    binds to the modulo expression.

2/3 fixes a missing return on the package-1 failure path in
    spi_imx_dma_data_prepare(). The error path frees the
    dma_data array and the package-0 buffers, then falls through
    to "return 0" - the caller proceeds with a freed pointer.

3/3 makes spi_imx_setupxfer() propagate the prepare_transfer()
    return value. Currently a -EINVAL from mx51_ecspi_prepare_transfer
    (e.g. on a word_delay overflow) is silently swallowed and the
    transfer proceeds with a partially-configured controller.

Regards,

John Madieu (3):
  spi: imx: Fix precedence bug in spi_imx_dma_max_wml_find()
  spi: imx: Fix UAF on package-1 prepare failure in
    spi_imx_dma_data_prepare()
  spi: imx: Propagate prepare_transfer() error from spi_imx_setupxfer()

 drivers/spi/spi-imx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.25.1
Re: [PATCH 0/3] spi: imx: Three fixes for the i.MX SPI driver
Posted by Mark Brown 1 month, 1 week ago
On Fri, 01 May 2026 13:59:48 +0000, John Madieu wrote:
> spi: imx: Three fixes for the i.MX SPI driver
> 
> Hi All,
> 
> This series independent fixes found in the i.MX SPI driver.
> 
> These are:
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1

Thanks!

[1/3] spi: imx: Fix precedence bug in spi_imx_dma_max_wml_find()
      https://git.kernel.org/broonie/spi/c/24e0fd8b8520
[2/3] spi: imx: Fix UAF on package-1 prepare failure in spi_imx_dma_data_prepare()
      https://git.kernel.org/broonie/spi/c/f5b554825504
[3/3] spi: imx: Propagate prepare_transfer() error from spi_imx_setupxfer()
      https://git.kernel.org/broonie/spi/c/894e04b71162

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark