diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2020-06-04 12:59:16 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-06-04 12:59:16 -0500 |
commit | d611b2b85331f3c69863d78835e95d1a5d01f2ef (patch) | |
tree | 7dae23a1a608ecfc7a84b05826e56a45268dc10e /drivers/pci | |
parent | b9fcf4910b72dd4d94b36989df5d6bcf7795c18d (diff) | |
parent | 0e86d981f9b7252e9716c5137cd8e4d9ad8ef32f (diff) | |
download | lwn-d611b2b85331f3c69863d78835e95d1a5d01f2ef.tar.gz lwn-d611b2b85331f3c69863d78835e95d1a5d01f2ef.zip |
Merge branch 'remotes/lorenzo/pci/endpoint'
- Avoid NULL pointer dereference in dma_release_channel() (Kunihiko
Hayashi)
* remotes/lorenzo/pci/endpoint:
PCI: endpoint: functions/pci-epf-test: Fix DMA channel release
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/endpoint/functions/pci-epf-test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 60330f3e3751..c89a9561439f 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -187,6 +187,9 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test) */ static void pci_epf_test_clean_dma_chan(struct pci_epf_test *epf_test) { + if (!epf_test->dma_supported) + return; + dma_release_channel(epf_test->dma_chan); epf_test->dma_chan = NULL; } |