kernel_optimize_test/drivers/spi
Xin Xiong e895e067d7 spi: uniphier: fix reference count leak in uniphier_spi_probe()
commit 37c2c83ca4f1ef4b6908181ac98e18360af89b42 upstream.

The issue happens in several error paths in uniphier_spi_probe().
When either dma_get_slave_caps() or devm_spi_register_master() returns
an error code, the function forgets to decrease the refcount of both
`dma_rx` and `dma_tx` objects, which may lead to refcount leaks.

Fix it by decrementing the reference count of specific objects in
those error paths.

Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Fixes: 28d1dddc59 ("spi: uniphier: Add DMA transfer mode support")
Link: https://lore.kernel.org/r/20220125101214.35677-1-xiongx18@fudan.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-08 18:30:37 +01:00
..
atmel-quadspi.c
internals.h
Kconfig
Makefile
spi-altera.c
spi-amd.c
spi-ar934x.c
spi-armada-3700.c spi: change clk_disable_unprepare to clk_unprepare 2021-12-29 12:25:54 +01:00
spi-at91-usart.c
spi-ath79.c spi: ath79: remove spi-master setup and cleanup assignment 2021-05-11 14:47:16 +02:00
spi-atmel.c spi: atmel: Put allocated master before return 2021-03-04 11:37:59 +01:00
spi-au1550.c
spi-axi-spi-engine.c
spi-bcm-qspi.c spi: bcm-qspi: check for valid cs before applying chip select 2022-02-08 18:30:37 +01:00
spi-bcm-qspi.h
spi-bcm63xx-hsspi.c
spi-bcm63xx.c
spi-bcm2835.c spi: spi-bcm2835: Fix deadlock 2021-07-28 14:35:40 +02:00
spi-bcm2835aux.c
spi-bitbang-txrx.h
spi-bitbang.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-brcmstb-qspi.c
spi-butterfly.c
spi-cadence-quadspi.c spi: cadence: set cqspi to the driver_data field of struct device 2021-03-25 09:04:04 +01:00
spi-cadence.c spi: cadence: Correct initialisation of runtime PM again 2021-07-28 14:35:39 +02:00
spi-cavium-octeon.c
spi-cavium-thunderx.c
spi-cavium.c
spi-cavium.h
spi-clps711x.c
spi-coldfire-qspi.c spi: coldfire-qspi: Use clk_disable_unprepare in the remove function 2021-09-15 09:50:29 +02:00
spi-davinci.c spi: davinci: invoke chipselect callback 2021-09-15 09:50:30 +02:00
spi-dln2.c spi: dln2: Fix reference leak to master 2021-05-11 14:47:20 +02:00
spi-dw-bt1.c spi: dw: Avoid stack content exposure 2021-03-04 11:38:07 +01:00
spi-dw-core.c
spi-dw-dma.c
spi-dw-mmio.c
spi-dw-pci.c
spi-dw.h
spi-efm32.c
spi-ep93xx.c
spi-falcon.c
spi-fsi.c
spi-fsl-cpm.c
spi-fsl-cpm.h
spi-fsl-dspi.c spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config 2021-09-15 09:50:28 +02:00
spi-fsl-espi.c
spi-fsl-lib.c
spi-fsl-lib.h
spi-fsl-lpspi.c spi: fsl-lpspi: Fix PM reference leak in lpspi_prepare_xfer_hardware() 2021-05-14 09:50:18 +02:00
spi-fsl-qspi.c
spi-fsl-spi.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-fsl-spi.h
spi-geni-qcom.c
spi-gpio.c
spi-hisi-sfc-v3xx.c
spi-img-spfi.c
spi-imx.c spi: imx: mx51-ecspi: Fix low-speed CONFIGREG delay calculation 2021-08-12 13:22:04 +02:00
spi-iproc-qspi.c
spi-jcore.c
spi-lantiq-ssc.c
spi-lm70llp.c
spi-loopback-test.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
spi-lp8841-rtc.c
spi-mem.c
spi-meson-spicc.c spi: meson-spicc: add IRQ check in meson_spicc_probe 2022-02-08 18:30:37 +01:00
spi-meson-spifc.c spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe 2022-01-27 10:54:03 +01:00
spi-mpc52xx-psc.c
spi-mpc52xx.c
spi-mpc512x-psc.c
spi-mt65xx.c spi: mediatek: Avoid NULL pointer crash in interrupt 2022-02-08 18:30:37 +01:00
spi-mt7621.c
spi-mtk-nor.c
spi-mux.c spi: spi-mux: Add module info needed for autoloading 2021-08-26 08:35:35 -04:00
spi-mxic.c
spi-mxs.c
spi-npcm-fiu.c
spi-npcm-pspi.c
spi-nxp-fspi.c spi: spi-nxp-fspi: move the register operation after the clock enable 2021-06-30 08:47:17 -04:00
spi-oc-tiny.c
spi-omap-100k.c spi: omap-100k: Fix the length judgment problem 2021-07-14 16:55:50 +02:00
spi-omap-uwire.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-omap2-mcspi.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-orion.c
spi-pic32-sqi.c
spi-pic32.c spi: spi-pic32: Fix issue with uninitialized dma_slave_config 2021-09-15 09:50:28 +02:00
spi-pl022.c spi: spl022: fix Microwire full duplex mode 2021-11-18 14:03:43 +01:00
spi-ppc4xx.c
spi-pxa2xx-dma.c
spi-pxa2xx-pci.c spi: pxa2xx: Fix the controller numbering for Wildcat Point 2021-03-04 11:38:06 +01:00
spi-pxa2xx.c spi: Cleanup on failure of initial setup 2021-06-16 12:01:38 +02:00
spi-pxa2xx.h
spi-qcom-qspi.c
spi-qup.c spi: qup: fix PM reference leak in spi_qup_remove() 2021-05-11 14:47:20 +02:00
spi-rb4xx.c
spi-rockchip.c spi: rockchip: handle zero length transfers without timing out 2021-10-09 14:40:55 +02:00
spi-rpc-if.c spi: spi-rpc-if: Check return value of rpcif_sw_init() 2021-11-18 14:04:11 +01:00
spi-rspi.c
spi-s3c24xx-regs.h
spi-s3c24xx.c
spi-s3c64xx.c
spi-sc18is602.c
spi-sh-hspi.c
spi-sh-msiof.c
spi-sh-sci.c
spi-sh.c
spi-sifive.c
spi-sirf.c
spi-slave-mt27xx.c
spi-slave-system-control.c
spi-slave-time.c
spi-sprd-adi.c spi: sprd: Fix the wrong WDG_LOAD_VAL 2021-09-15 09:50:30 +02:00
spi-sprd.c spi: sprd: Add missing MODULE_DEVICE_TABLE 2021-06-16 12:01:35 +02:00
spi-st-ssc4.c
spi-stm32-qspi.c spi: stm32-qspi: Always wait BUSY bit to be cleared in stm32_qspi_wait_cmd() 2021-06-23 14:42:48 +02:00
spi-stm32.c spi: stm32h7: fix full duplex irq handler handling 2021-08-08 09:05:22 +02:00
spi-sun4i.c
spi-sun6i.c spi: spi-sun6i: Fix chipselect/clock bug 2021-07-14 16:56:10 +02:00
spi-synquacer.c spi: spi-synquacer: fix set_cs handling 2021-03-04 11:38:43 +01:00
spi-tegra20-sflash.c
spi-tegra20-slink.c spi: Fix tegra20 build with CONFIG_PM=n 2021-09-30 10:11:07 +02:00
spi-tegra114.c
spi-test.h
spi-ti-qspi.c spi: spi-ti-qspi: Free DMA resources 2021-05-11 14:47:13 +02:00
spi-tle62x0.c
spi-topcliff-pch.c spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages() 2021-07-14 16:55:50 +02:00
spi-txx9.c
spi-uniphier.c spi: uniphier: fix reference count leak in uniphier_spi_probe() 2022-02-08 18:30:37 +01:00
spi-xcomm.c
spi-xilinx.c
spi-xlp.c
spi-xtensa-xtfpga.c
spi-zynq-qspi.c spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op not interruptible 2021-09-15 09:50:30 +02:00
spi-zynqmp-gqspi.c spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails 2021-05-14 09:50:20 +02:00
spi.c spi: Avoid undefined behaviour when counting unused native CSs 2021-07-14 16:56:02 +02:00
spidev.c