Commit e216d85e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents ddae1043 27cd2dde
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ properties:
          - fsl,ls1021a-qspi
          - fsl,ls2080a-qspi
          - spacemit,k1-qspi
      - items:
          - const: spacemit,k3-qspi
          - const: spacemit,k1-qspi
      - items:
          - enum:
              - fsl,ls1043a-qspi
+2 −0
Original line number Diff line number Diff line
@@ -582,12 +582,14 @@ static int ep93xx_spi_setup_dma(struct device *dev, struct ep93xx_spi *espi)
	espi->dma_rx = dma_request_chan(dev, "rx");
	if (IS_ERR(espi->dma_rx)) {
		ret = dev_err_probe(dev, PTR_ERR(espi->dma_rx), "rx DMA setup failed");
		espi->dma_rx = NULL;
		goto fail_free_page;
	}

	espi->dma_tx = dma_request_chan(dev, "tx");
	if (IS_ERR(espi->dma_tx)) {
		ret = dev_err_probe(dev, PTR_ERR(espi->dma_tx), "tx DMA setup failed");
		espi->dma_tx = NULL;
		goto fail_release_rx;
	}

+1 −1
Original line number Diff line number Diff line
@@ -961,7 +961,7 @@ static int mtk_snand_read_page_cache(struct mtk_snand *snf,
		    &snf->op_done, usecs_to_jiffies(SNFI_POLL_INTERVAL))) {
		dev_err(snf->dev, "DMA timed out for reading from cache.\n");
		ret = -ETIMEDOUT;
		goto cleanup;
		goto cleanup2;
	}

	// Wait for BUS_SEC_CNTR returning expected value
+3 −0
Original line number Diff line number Diff line
@@ -996,8 +996,11 @@ static int spi_qup_init_dma(struct spi_controller *host, resource_size_t base)

err:
	dma_release_channel(host->dma_tx);
	host->dma_tx = NULL;
err_tx:
	dma_release_channel(host->dma_rx);
	host->dma_rx = NULL;

	return ret;
}

+2 −1
Original line number Diff line number Diff line
@@ -991,6 +991,7 @@ static int sprd_spi_probe(struct platform_device *pdev)
disable_clk:
	clk_disable_unprepare(ss->clk);
release_dma:
	if (ss->dma.enable)
		sprd_spi_dma_release(ss);
free_controller:
	spi_controller_put(sctlr);
Loading