Skip to content

Commit e216d85

Browse files
committed
Merge tag 'spi-fix-v7.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "Another batch of driver fixes from Johan fixing error handling paths, plus another from Felix. We also have a new device ID added in the DT bindings for SpacemiT K3" * tag 'spi-fix-v7.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: dt-bindings: fsl-qspi: support SpacemiT K3 spi: ti-qspi: fix use-after-free after DMA setup failure spi: sprd: fix error pointer deref after DMA setup failure spi: qup: fix error pointer deref after DMA setup failure spi: mtk-snfi: Fix resource leak in mtk_snand_read_page_cache() spi: ep93xx: fix error pointer deref after DMA setup failure
2 parents ddae104 + 27cd2dd commit e216d85

6 files changed

Lines changed: 12 additions & 2 deletions

File tree

Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ properties:
2020
- fsl,ls1021a-qspi
2121
- fsl,ls2080a-qspi
2222
- spacemit,k1-qspi
23+
- items:
24+
- const: spacemit,k3-qspi
25+
- const: spacemit,k1-qspi
2326
- items:
2427
- enum:
2528
- fsl,ls1043a-qspi

drivers/spi/spi-ep93xx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,14 @@ static int ep93xx_spi_setup_dma(struct device *dev, struct ep93xx_spi *espi)
582582
espi->dma_rx = dma_request_chan(dev, "rx");
583583
if (IS_ERR(espi->dma_rx)) {
584584
ret = dev_err_probe(dev, PTR_ERR(espi->dma_rx), "rx DMA setup failed");
585+
espi->dma_rx = NULL;
585586
goto fail_free_page;
586587
}
587588

588589
espi->dma_tx = dma_request_chan(dev, "tx");
589590
if (IS_ERR(espi->dma_tx)) {
590591
ret = dev_err_probe(dev, PTR_ERR(espi->dma_tx), "tx DMA setup failed");
592+
espi->dma_tx = NULL;
591593
goto fail_release_rx;
592594
}
593595

drivers/spi/spi-mtk-snfi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ static int mtk_snand_read_page_cache(struct mtk_snand *snf,
961961
&snf->op_done, usecs_to_jiffies(SNFI_POLL_INTERVAL))) {
962962
dev_err(snf->dev, "DMA timed out for reading from cache.\n");
963963
ret = -ETIMEDOUT;
964-
goto cleanup;
964+
goto cleanup2;
965965
}
966966

967967
// Wait for BUS_SEC_CNTR returning expected value

drivers/spi/spi-qup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,11 @@ static int spi_qup_init_dma(struct spi_controller *host, resource_size_t base)
996996

997997
err:
998998
dma_release_channel(host->dma_tx);
999+
host->dma_tx = NULL;
9991000
err_tx:
10001001
dma_release_channel(host->dma_rx);
1002+
host->dma_rx = NULL;
1003+
10011004
return ret;
10021005
}
10031006

drivers/spi/spi-sprd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,8 @@ static int sprd_spi_probe(struct platform_device *pdev)
991991
disable_clk:
992992
clk_disable_unprepare(ss->clk);
993993
release_dma:
994-
sprd_spi_dma_release(ss);
994+
if (ss->dma.enable)
995+
sprd_spi_dma_release(ss);
995996
free_controller:
996997
spi_controller_put(sctlr);
997998

drivers/spi/spi-ti-qspi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
867867
dev_err(qspi->dev,
868868
"dma_alloc_coherent failed, using PIO mode\n");
869869
dma_release_channel(qspi->rx_chan);
870+
qspi->rx_chan = NULL;
870871
goto no_dma;
871872
}
872873
host->dma_rx = qspi->rx_chan;

0 commit comments

Comments
 (0)