Skip to content
Commit 0e86d981 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by Lorenzo Pieralisi
Browse files

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: 5ebf3fc5 ("PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer data")
Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
[lorenzo.pieralisi@arm.com: commit log]
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 8f3d9f35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment