lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Jul 2022 13:12:15 +0000
From:   Peng Wu <wupeng58@...wei.com>
To:     <kishon@...com>, <lpieralisi@...nel.org>, <kw@...ux.com>,
        <bhelgaas@...gle.com>
CC:     <linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <liwei391@...wei.com>, <wupeng58@...wei.com>
Subject: [PATCH] PCI: endpoint: Fix a NULL vs IS_ERR() check in pci_epf_test_init_dma_chan()

On failure, dma_request_channel() returns NULL and not a
ERR_PTR() value. Fix return value checking by using is NULL.

Signed-off-by: Peng Wu <wupeng58@...wei.com>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 34aac220dd4c..eed6638ab71d 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -221,7 +221,7 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test)
 	filter.dma_mask = BIT(DMA_MEM_TO_DEV);
 	dma_chan = dma_request_channel(mask, epf_dma_filter_fn, &filter);
 
-	if (IS_ERR(dma_chan)) {
+	if (!dma_chan) {
 		dev_info(dev, "Failed to get private DMA tx channel. Falling back to generic one\n");
 		goto fail_back_rx;
 	}
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ