Skip to content

spi: imx: Three fixes for the i.MX SPI driver

John Madieu imx linux-arm-kernel linux-spi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3spi: imx: Fix precedence bug in spi_imx_dma_max_wml_find()drivers/spi/spi-imx.c+1 -11 reply
2/3spi: imx: Fix UAF on package-1 prepare failure in spi_imx_dma_data_prepare()drivers/spi/spi-imx.c+1 -01 reply
3/3spi: imx: Propagate prepare_transfer() error from spi_imx_setupxfer()drivers/spi/spi-imx.c+1 -31 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchFrank Li
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] 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:

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(-)
Signature · 1 line
2.25.1