]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: endpoint: functions/pci-epf-test: Fix DMA channel release
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Wed, 22 Apr 2020 07:24:47 +0000 (16:24 +0900)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 5 May 2020 11:23:07 +0000 (12:23 +0100)
commit99cd7fcf9753fff5a71572ce4a76f06260e60229
treed56c72b3439bf828306e86bfa3c4db249626ffc9
parent9b8057e7f937f20763a90a8fc2333168af101732
PCI: endpoint: functions/pci-epf-test: Fix DMA channel release

When unbinding pci_epf_test, pci_epf_test_clean_dma_chan() is called in
pci_epf_test_unbind() even though epf_test->dma_supported is false.

As a result, dma_release_channel() will trigger a NULL pointer
dereference because dma_chan is not set.

Avoid calling dma_release_channel() if epf_test->dma_supported
is false.

Link: https://lore.kernel.org/r/1587540287-10458-1-git-send-email-hayashi.kunihiko@socionext.com
Fixes: 13306fba823a ("PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer data")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
[lorenzo.pieralisi@arm.com: commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/pci/endpoint/functions/pci-epf-test.c