Skip to content

Commit b1b1f4b

Browse files
khalfellabjorn-helgaas
authored andcommitted
PCI: endpoint: pci-epf-test: Set dma_chan_rx pointer to NULL on error
If dma_chan_tx allocation fails, set dma_chan_rx to NULL after it is freed. Link: https://lore.kernel.org/r/20241227160841.92382-1-khalfella@gmail.com Fixes: 8353813 ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Signed-off-by: Mohamed Khalfella <khalfella@gmail.com> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1 parent 40384c8 commit b1b1f4b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pci/endpoint/functions/pci-epf-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
251251

252252
fail_back_rx:
253253
dma_release_channel(epf_test->dma_chan_rx);
254-
epf_test->dma_chan_tx = NULL;
254+
epf_test->dma_chan_rx = NULL;
255255

256256
fail_back_tx:
257257
dma_cap_zero(mask);

0 commit comments

Comments
 (0)